ComponentOne True DBGrid Pro 8
Selecting rows

If the AllowRowSelect and RecordSelectors properties are both True, the user can select records with the mouse. When the user points to a button within the record selector column, the mouse pointer changes to a right arrow to indicate that record selection is enabled.

If enabled, record selection behavior is determined by the MultiSelect property. By default, this property is set to 1 - Simple, and the user can select one or more records with the mouse. When the user clicks the record selector for a row, that row is selected and highlighted, and any rows or columns that were previously selected are deselected. The newly selected row also becomes the current row.

However, unlike column selections, nonadjacent row selections are supported. If the user holds down the Ctrl key while making the selection, the current row does not change, and any previously selected rows remain selected. This technique also enables the user to select multiple rows, one at a time. Since selected rows do not have to be adjacent, the user can also operate the vertical scroll bar to bring other rows into view if desired.

The user can also select a range of contiguous rows by clicking the record selector of the first row in the range, then holding down the Shift key and clicking the record selector of the last row in the range. If necessary, the vertical scroll bar can be used to bring additional rows into view.

If MultiSelect is set to 2 - Extended, the default behavior is supported, but the user can also select records with the following key combinations: Shift + Up Arrow, Shift + Down Arrow, Shift + PgUp, and Shift + PgDn. Note:When 2 - Extended is chosen, the user will not be able to select a single cell, instead the entire corresponding row will be selected.

If MultiSelect is set to 0 - None, multiple selection is disabled but single selection is permitted. When the user clicks a record selector, the current selection is cleared and the clicked row is selected and highlighted. However, the Ctrl and Shift keys are ignored, and the user can only select one row at a time.

If the value of MultiSelect is set to 0 or 1, the user can deselect all rows by clicking a data cell or selecting columns. Clicking the record selector of a selected row does not deselect it.

The SelBookmarks collection will always be updated to reflect which rows are currently selected by the user. You can always select one or more rows in code by adding bookmarks to the SelBookmarks collection, even if MultiSelect is 0 - None. Similarly, you can deselect rows by removing bookmarks from this collection.

You can prevent a row selection from occurring at run time by setting the Cancel argument to True in the grid's SelChange event.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback