T
T
tuxx2014-04-20 23:09:22
Delphi
tuxx, 2014-04-20 23:09:22

Delphi. Select in DBLookupComboBox on click in DBGrid

The form has a DbGrid with different fields (the NumContract field of interest) and a DBLookupComboBox. By clicking on any cell in the grid, a field with a number should be selected in the combobox, as in NumContract. I set the ListSource with the required DataSource at the combobox, and select NumContract in the ListField and KeyField. However, when clicked in the grid, the combobox does not select any value, but contains all the NumContract values ​​from the DBGrid. Maybe I'm doing something wrong?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2014-04-21
@ncix

Please show the source and .dfm.

A
Alexander, 2014-04-21
@ncix

@tuxx You have DBGrid bound to DataModule2.ContractDataSource and all DBLookupComboBox bound to other data sources:

object DBLookupComboboxEh1: TDBLookupComboboxEh
        ListSource = DataModule2.ContributionDataSource

      object DBLookupComboboxEh2: TDBLookupComboboxEh
        ListSource = DataModule2.ClientDataSource

      object DBLookupComboboxEh3: TDBLookupComboboxEh
        ListSource = DataModule2.BankDataSource

      object DBLookupComboboxEh4: TDBLookupComboboxEh
        ListSource = DataModule2.CurrencyDataSource

Maybe this is the issue?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question