RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBLookupComboBox.KeyField Property

Identifies the field in the ListSource dataset that must match the value of the DataField field.

Pascal
property KeyField: string;
C++
__property AnsiString KeyField;

Use KeyField to link the ListSource of the lookup control to the DataSource. Although the name of the field specified as the KeyField does not have to be the same as the name of the field specified as the DataField, the two fields must have the same values.  

After specifying the ListField, choose which field the lookup control will actually display with the ListField property. 

If the DataField field is a lookup field, don't specify anything for KeyField or ListField; lookup controls automatically use the data field's LookupKeyFields property for KeyField. 

 

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