Sign in Join
FPDoc Onlineexperiment

TDBLookupListBox.DataChange procedure

Member of TDBLookupListBoxprotectedIn unit DBCtrls

Performs actions needed when a new DataField value is selected using the lookup dataset.

Declaration

pascal
procedure DataChange(Sender: TObject); override

Description

DataChange is an overridden method in TDBLookupListBox. It implements the abstract virtual method defined in the ancestor class, and provides support for setting the value in ItemIndex when the value for KeyField in the lookup dataset has changed.

DataChange uses the internal TFieldDataLink instance in the control to determine if the linked dataset has been opened. If the dataset is active, the value in ItemIndex is set to the key index position from the lookup dataset. If the linked dataset is not active, the value in ItemIndex is set to -1 (indicating no item is selected in the control).

DataChange is used as the OnDataChange event handler for the internal TFieldDataLink instance in the control, and called from the DoSelectionChange method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.