Hi,
i need an inplace lookup field in the grid which feeds from another table.
Let's say i have a CITIES (ID, Name, Country_ID) table and a COUNTRIES (ID, Name) table
i have 2 FIBdatasets (+ TFIBdatabase + TFIBtransaction), 2 datasources
i have a grid which is connected to cities through datasource
i set up the Column Editor so i'll have 2 columns:
Name - editable text Country - this should be a lookup dropdown field which lists the countries
i set up the following for Country column:
DropDownBox.ListSource = dsCountry (datasource connected to Country dataset) DropDownBox.Columns -> Add (FieldName = NAME) - something is wrong here because it doesn't show the available fields of Country, so i just type NAME in the field (i emphasize, both datasets are open)
I also set LookupDisplayFields = NAME (but i guess is the same as DropDownBox.Columns
something is missing here....i set up what to show in the dropdown, but how do i specify the KeyField?
in the grid i can see the ID of the Country, a numeric value
in my grid the value should be the ID from the country table, but it should show Country name and dropdown icon
What am i doing wrong?
|