- r = m_grid->BlockToDeviceRect(
- wxGridCellCoords( 0, col ),
- wxGridCellCoords( m_grid->GetNumberRows() - 1, col ) );
- ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
- }
+ if ( m_rowSelection.Index(rowTo) >= 0 || rowTo == numRows )
+ {
+ if (rowFrom < rowTo)
+ {
+ if ( !m_grid->GetBatchCount() )
+ {
+ r = m_grid->BlockToDeviceRect(
+ wxGridCellCoords( rowFrom, col ),
+ wxGridCellCoords( rowTo - 1, col ) );
+ ((wxWindow *)m_grid->m_gridWin)->Refresh( false, &r );
+ }
+
+ wxGridRangeSelectEvent gridEvt( m_grid->GetId(),
+ wxEVT_GRID_RANGE_SELECT,
+ m_grid,
+ wxGridCellCoords( rowFrom, col ),
+ wxGridCellCoords( rowTo - 1, col ),
+ false,
+ kbd );
+ m_grid->GetEventHandler()->ProcessEvent( gridEvt );
+ }