Use DBLookupComboBox with only one table and a ClientDataset

1

People, I have a question about using DBLookupCombobox in Delphi. Home Is it possible, instead of using two tables (picking values from one and writing to another), do I just have the table where I will write the selected value to pull the data from a ClientDataset with the values? Home 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. Home Thank you.

    
asked by anonymous 06.07.2016 / 01:52

1 answer

2

Yes Rodrigo, you just create a TDataSource pointing to your ClientDataSet, and in the DBLookupComboBox property, you set the ListSource to its TDataSource created, and ListField and KeyField to the display fields and keys, respectively.

Remembering that you do not necessarily have to have a second table directly linked to your DBLookupComboBox in the DataSource property, you can access the selected record by the KeyValue property, it returns its selected value to its KeyField .

    
06.07.2016 / 05:08