[Lazarus] How to use DBCombobox

Reinier Olislagers reinierolislagers at gmail.com
Mon Jun 18 11:44:39 CEST 2012


On 18-6-2012 11:31, Koenraad Lelong wrote:
> On 18-06-12 11:28, Koenraad Lelong wrote:
>>
>> No suggestions what I'm doing wrong ?
>>
>> I enclose a project, using the employee-database.
>>
>> Regards,
>>
>> Koenraad Lelong.
> 
> Hi,
> 
> I forgot to say that scrolling the grid makes the highlighted field of
> the grid appear in the combobox, but only that field is available, not
> other fields are visible.

Apparently the combobox is bound to the CUSTOMER datafield in the
datasource => the customer name field in the customers table.
If you move down the grid, that is also linked to the datasource, the
combobox value changes because the bound field changes.
No idea what this dbcombobox is for... but my Delphi experience is near
zero and imagination has not yet been too coffee-fuelled yet.

Try seeing if a DBLookupCombobox does what you want: it should let you
select a value out of another table and insert that into the field bound
to the dblookupcombobox.






More information about the Lazarus mailing list