Use Dblookupcombobox with only one table and one Clientdataset

Asked

Viewed 761 times

1

People, I have a question about using Dblookupcombobox in Delphi.
It is possible, instead of using two tables (take values from one and write to another), I have only the table where I will save the selected value to pull the data from a Clientdataset with the values?
I do not want to create a table just to pull the data to the DBLC, I would like to pull the data from a CDS with the values.

Thank you.

1 answer

2


Yes Rodrigo, just create one TDataSource pointing to your Clientdataset, and on the property of DBLookupComboBox you arrow the ListSource for your TDataSource created, and the ListField and KeyField for the display fields and keys respectively.

Remembering that you don’t necessarily need to have a second table directly linked to your DBLookupComboBox on the property DataSource, you can access the selected record through the property KeyValue, it returns the respective selected value to your KeyField.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.