Vcl.DBCtrls.TDBLookupControl.KeyField

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property KeyField: string read GetKeyFieldName write SetKeyFieldName;

C++

__property System::UnicodeString KeyField = {read=GetKeyFieldName, write=SetKeyFieldName};

Properties

Type Visibility Source Unit Parent
property protected
Vcl.DBCtrls.pas
Vcl.DBCtrls.hpp
Vcl.DBCtrls TDBLookupControl

Description

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