Sign in Join
FPDoc Onlineexperiment

TDBLookup class

In unit DBCtrls

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

Declaration

pascal
TDBLookup = class(TComponent)

Inheritance

  1. TDBLookup
  2. TComponent
  3. TPersistent
  4. 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.

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

Properties

ControlItemspublicContains the items displayed for the lookup control.
LookupCachepublicIndicates if look-up information is cached in the field data link for the control.
KeyFieldpublicThe name of the KeyField used in the lookup search.
ListFieldpublicListField - the name of the list field displayed for the lookup.
ListFieldIndexpublicListFieldIndex - the index value of the list field.
ListSourcepublicListSource - the data source that contains the lookup list.
NullValueKeypublicKeyboard shortcut which causes an empty value to be assigned to each of the key fields defined for the lookup control.
ScrollListDatasetpublicIndicates if the Dataset in ListSource can be scrolled when loading/locating key and display values.
EmptyValuepublicValue stored for the lookup control when a lookup value is not available.
DisplayEmptypublicValue displayed in the lookup control when a lookup value is not available.

Methods

NotificationprotectedPerforms the notification message received for a component in the class instance.
CreatepublicConstructor for the class instance.
DestroypublicDestructor for the class instance.
InitializepublicInitialize makes links between local Fields and the appropriate fields in the remote data source, then fetches the lookup data.
KeyFieldValuepublicGets the value(s) for one or more key fields defined for the Field in the linked dataset.
UpdateDatapublicSignals the OnUpdateData event handler for pending changes to the linked dataset.
GetKeyValuepublicGets the value for the key field at the specified ordinal position in the list of values from the lookup dataset.
GetKeyIndexpublicGets the ordinal position in the list for the specified key value.

Inherited

From TComponent (73)

_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode UpdateAction Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState

From TPersistent (5)

Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (37)

AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName

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