ComponentOne List 8.0 for ActiveX
Selecting List Items

The following properties are used to set or get the current list item for a TDBList or TDBCombo control:

BoundText

Text value of the BoundColumn field

SelectedItem

Sets/returns the bookmark of the currently selected item

The BoundText property always reflects the value of the BoundColumn field within the list portion of the control.As the current record within the Recordset (Data control) associated with the DataSource property changes, the BoundText property receives the value specified by DataField. The list or combo control then searches the records in its list to see if the BoundText value matches any BoundColumn field. If a match is found, the record is highlighted in the list or placed in the text box portion of the combo control.If no match is found, the list selection is cancelled and BoundText returns an empty string.

You can use the SelectedItem property to retrieve the bookmark of the current list item.Setting this property to a valid RowSource bookmark highlights the corresponding list item or places the appropriate value in the text box portion of a combo control.

TDBList controls also support a multiple selection mode:

MultiSelect

Controls whether users can select multiple rows

SelBookmarks

Contains a collection of selected row bookmarks

If the MultiSelect property is 0 - None, only one item in the list can be selected at any time.  This is the default behavior.

If the MultiSelect property is 1 - Simple and the user clicks a row, that row is selected and the SelectedItem property returns a bookmark for that row.If more than one row is selected, the SelectedItem property returns the bookmark of the most recently selected row, and the SelBookmarks collection contains the bookmarks for all selected rows.

If the MultiSelect property is 2 - Extended, pressing Shift and clicking the mouse or pressing Shift and one of the arrow keys (Up Arrow, Down Arrow, Left Arrow, or Right Arrow) extends the selection from the previously selected item to the current item.  Pressing Ctrl and clicking the mouse selects or deselects an item in the list. 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.

If the MultiSelect property is 3 - Checkbox, the user can select or unselect rows by clicking checkboxes.

When one of the multiple selection modes is in effect, no updates will occur.

 

 


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

Product Support Forum  |  Documentation Feedback