Row selection is also very easy to master with True DBGrid for WinForms. When the cursor hovers over the record selector to the left of a row, a small arrow will indicate that this row is about to be selected. Then by clicking on this record selector, the row then becomes selected. To select a contiguous range of rows, manipulate the arrow keys while holding down the shift button. This will select the cells in every field for the range of rows that the user has selected. To select a non-contiguous range of rows, click on the rows to be selected while holding down the CTRL button. This will select the cells in every field for the set of non-contiguous rows that the user has selected.
In order to find out which rows have been selected at run-time, query the SelectedRowCollection. This is a collection of all the row indices for the selected rows. For instance, if rows 5 through 10 are selected, the SelectedRowCollection will have six members. Each member will be an integer value and will be an integer that corresponds to the absolute row position of the selected row.