ComponentOne List 8.0 for ActiveX
Selecting rows (TDBList only)

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 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 first row in the range, then holding down the Shift key and clicking 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.

If MultiSelect is set to 0 - None, multiple selection is disabled but single selection is permitted. When the user clicks an unselected row, 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.

Regardless of the value of MultiSelect, the user can deselect all rows by clicking a data cell or selecting columns. In code, setting the BoundText property to an empty string also deselects all rows.

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 list's SelChange event.

 

 


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

Product Support Forum  |  Documentation Feedback