Row selection is also very easy to master with the True DBGrid. When the cursor hovers over the recordselector to the left of a row, a small arrow will indicate that this row is about to be selected. Then by clicking on this recordselector, 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.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |