[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'DBCtrls' (#lcl)

TDBLookup

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TDBLookup - used as source of data by TDBLookupListBox or TDBLookupComboBox, to find data from a lookup table.

Declaration

Source position: dbctrls.pp line 116

type TDBLookup = class(TComponent)

protected

  procedure Notification(); override;

  

Performs the notification message received for a component in the class instance.

public

  constructor Create(); override;

  

Constructor for the class instance.

  destructor Destroy; override;

  

Destructor for the class instance.

  procedure Initialize();

  

Initialize makes links between local Fields and the appropriate fields in the remote data source, then fetches the lookup data.

  function KeyFieldValue;

  

Gets the value(s) for one or more key fields defined for the Field in the linked dataset.

  procedure UpdateData();

  

Signals the OnUpdateData event handler for pending changes to the linked dataset.

  function GetKeyValue();

  

Gets the value for the key field at the specified ordinal position in the list of values from the lookup dataset.

  function GetKeyIndex();

  

Gets the ordinal position in the list for the specified key value.

  property ControlItems: TStrings; [rw]

  

Contains the items displayed for the lookup control.

  property LookupCache: Boolean; [rw]

  

Indicates if look-up information is cached in the field data link for the control.

  property KeyField: string; [rw]

  

The name of the KeyField used in the lookup search.

  property ListField: string; [rw]

  

ListField - the name of the list field displayed for the lookup.

  property ListFieldIndex: Integer; [rw]

  

ListFieldIndex - the index value of the list field.

  property ListSource: TDataSource; [rw]

  

ListSource - the data source that contains the lookup list.

  property NullValueKey: TShortcut; [rw]

  

Keyboard shortcut which causes an empty value to be assigned to each of the key fields defined for the lookup control.

  property ScrollListDataset: Boolean; [rw]

  

Indicates if the Dataset in ListSource can be scrolled when loading/locating key and display values.

  property EmptyValue: string; [rw]

  

Value stored for the lookup control when a lookup value is not available.

  property DisplayEmpty: string; [rw]

  

Value displayed in the lookup control when a lookup value is not available.

end;

Inheritance

TDBLookup

  

TDBLookup - used as source of data by TDBLookupListBox or TDBLookupComboBox, to find data from a lookup table.

|

TComponent,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TDBLookup component is typically owned by a Lookup control like TDBLookupListBox or TDBLookupComboBox.

The ListSource is the TDataSource for the other Dataset from which lookup values are retrieved.

The KeyField is the lookup key in ListSource which corresponds to the DataField value.

The ListField is the name of the field in ListSource to list into the Items property of the lookup control.

Use EmptyValue to specify a KeyField value automatically added to the ControlItems property when the linked lookup dataset contains no records. No entry is added to Controlitems when the value in EmptyValue is an empty string (''). The value in DisplayEmpty is used for the ListField displayed in the control.

Version info

The EmptyValue and DisplayEmpty properties were added in revision 62844, and released in LCL version 2.0.8 and higher.


Version 3.2 Generated 2024-02-25 Home