Vcl.DBCtrls.TDBListBox.DataField

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DataField: string read GetDataField write SetDataField;

C++

__property System::UnicodeString DataField = {read=GetDataField, write=SetDataField};

Properties

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

Description

Identifies the field whose value is displayed by the listbox.

Set DataField to specify which field is represented by the listbox. The listbox displays the current value of this field, and lets the user set its value on the current record. The dataset in which the field is located is specified by the DataSource property.

Set DataField to specify which field is represented by the listbox. (Note that this is does not refer to the source of the list, but to the field into which the selected value is inserted. The list values must be supplied manually using the Items property.) The listbox displays the current value of this field as the selected (highlighted) item, and allows the user to set the value of this field on the current record by selecting a value from the list. The dataset the field is located in is specified by the DataSource property.



DBListBox1.DataField := 'CountryName';



DBListBox1->DataField = "CountryName";



Tip: For a data-aware listbox component for which the list values are automatically supplied, use a TDBLookupListBox instead.

See Also