The grid also has a selection, which is a rectangular range of cells defined by two opposing corners: the cursor (Row, Col properties) and the cell defined by the RowSel and ColSel properties. The user may change the selection using the keyboard or the mouse. Changing the RowSel and ColSel properties in code also changes the selection.
When the Row or Col properties change, RowSel and ColSel are automatically reset and the selection collapses into a single cell, the cursor. To create selection in code, either set RowSel and ColSel after setting Row and Col, or use the Select method.
Several grid properties apply to the cursor or to the selection, depending on the setting of the FillStyle property. These include Text and all properties with names that start with Cell (CellBackColor, CellForeColor, and so on).