Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add lookup combo to dbgrid at truntime 1

Status
Not open for further replies.

bouncec

Programmer
Aug 5, 2008
2
GB
Hi All
I have not had any luck finding help with this elsewhere so hopefully someone out there knows...
Using InfoPower compnents I have a TwwDBGrid and need to assign the fields dynamically at runtime. That works just fine but then I need to make some fields use a CustomEdit lookup combo. Can create the lookup but have no idea how to link it to a field in the DBgrid.

Any help much appreciated.
 
First, you have to use persistent columns. (See Delphi help: "Creating persistent columns")

In the TColumn property PickList, fill with your selections. This can be done at runtime from another table.

It is much simpler to create an input dialog with a TDBLookupComboBox. Then you can set property ListSource to the lookup table and the KeyField and ListField properties to the choice field of your lookup table. Delphi will do all the work for you at run-time.

Roo
Delphi Rules!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top