RAD Studio |  |

Displaying and Editing Data in List and Combo Boxes
See Also
Collapse All

There are four data controls that provide the user with a set of default data values to choose from at runtime. These are data-aware versions of standard list and combo box controls:

- TDBListBox, which displays a scrollable list of items from which a user can choose to enter in a data field. A data-aware list box displays a default value for a field in the current record and highlights its corresponding entry in the list. If the current row's field value is not in the list, no value is highlighted in the list box. When a user selects a list item, the corresponding field value is changed in the underlying dataset.
- TDBComboBox, which combines the functionality of a data-aware edit control and a drop-down list. At runtime it can display a drop-down list from which a user can pick from a predefined set of values, and it can permit a user to enter an entirely different value.
- TDBLookupListBox, which behaves like TDBListBox except the list of display items is looked up in another dataset.
- TDBLookupComboBox, which behaves like TDBComboBox except the list of display items is looked up in another dataset.

The following topics describe these components in more detail:

- Using TDBListBox and TDBComboBox
- Displaying and Editing Data in Lookup List and Combo Boxes

Note: At runtime, users can use an incremental search to find list box items. When the control has focus, for example, typing 'ROB' selects the first item in the list box beginning with the letters 'ROB'. Typing an additional 'E' selects the first item starting with 'ROBE', such as 'Robert Johnson'. The search is case-insensitive. Backspace
and Esc cancel the current search string (but leave the selection intact), as does a two second pause between keystrokes.
See Also

Displaying Data as Labels

Displaying and Editing Fields in an Edit Box

Displaying and Editing Text in a Memo Control

Displaying and Editing Text in a Rich Edit Memo Control

Displaying and Editing Graphics Fields in an Image Control

Handling Boolean Field Values with Check Boxes

Restricting Field Values with Radio Controls

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!