RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBListBox.DataField Property

Identifies the field whose value is displayed by the listbox.

Pascal
property DataField: WideString;
C++
__property BSTR DataField;

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.
 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!