Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 29 Mar 2024, 10:08

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 21 Jun 2013, 05:35 
Offline

Joined: 11 Apr 2013, 06:51
Posts: 13
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?


Top
 Profile  
 
PostPosted: 21 Jun 2013, 18:12 
Offline
Администратор

Joined: 22 Dec 2011, 20:19
Posts: 335
Hello

Before customizing lookup column you need to create lookup field in the dataset and assign it to a Column.FieldName

Best regards
Admin

_________________
Best regards
Admin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group