RAD Studio |  |

Defining a Lookup List Column
See Also
Collapse All

You can create a column that displays a drop-down list of values, similar to a lookup combo box control. To specify that the column acts like a combo box, set the column's ButtonStyle property to cbsAuto. Once you populate the list with values, the grid automatically displays a combo box-like drop-down button when a cell of that column is in edit mode.

There are two ways to populate that list with the values for users to select:

- You can fetch the values from a lookup table. To make a column display a drop-down list of values drawn from a separate lookup table, you must define a lookup field in the dataset. Once the lookup field is defined, set the column's FieldName to the lookup field name. The drop-down list is automatically populated with lookup values defined by the lookup field.
- You can specify a list of values explicitly at design time. To enter the list values at design time, double-click the PickList property for the column in the Object Inspector. This brings up the String List editor, where you can enter the values that populate the pick list for the column.

By default, the drop-down list displays 7 values. You can change the length of this list by setting the DropDownRows property.
Note: To restore a column with an explicit pick list to its normal behavior, delete all the text from the pick list using the String List editor.
See Also

Creating Persistent Columns

Deleting Persistent Columns

Arranging the Order of Persistent Columns

Putting a Button in a Column

Setting Column Properties at Design Time

Restoring Default Values to a Column

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