API:Vcl.DBCtrls.TDBLookupComboBox.KeyField

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property KeyField: string read GetKeyFieldName write SetKeyFieldName default 0;

C++

__property KeyField = {default=0};

Properties

Type Visibility Source Unit Parent
property published
Vcl.DBCtrls.pas
Vcl.DBCtrls.hpp
Vcl.DBCtrls TDBLookupComboBox

Description

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

Vcl.DBCtrls.TDBLookupComboBox.KeyField inherits from Vcl.DBCtrls.TDBLookupControl.KeyField. All content below this line refers to Vcl.DBCtrls.TDBLookupControl.KeyField.

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

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.

See Also