dbgrid and lookup

Does anyone know how to setup a table lookup field on a DBGrid ?

i try to do  by Tfield and 4 some reasone its just not working ? (ie - i"m not getting drop down in the dbgrid )

if some one can send me and example it would be great to

10x in advance

Who is Participating?
MatveyConnect With a Mentor Commented:
Hi again, I sent you another example with some lookup fields.

I also found instructions in the help, and as far as I can see they should be correct:

To create a lookup field in the New Field dialog box:

1.      Enter a name for the lookup field in the Name edit box. Do not enter the name of an existing field.
2.      Choose a data type for the field from the Type combo box.
3.      Enter the size of the field in the Size edit box, if appropriate. Size is only relevant for fields of type TStringField, TBytesField, and TVarBytesField.
4.      Select Lookup in the Field type radio group. Selecting Lookup enables the Dataset and Key Fields combo boxes.
5.      Choose from the Dataset combo box drop-down list the dataset in which to look up field values. The lookup dataset must be different from the dataset for the field component itself, or a circular reference exception is raised at run time. Specifying a lookup dataset enables the Lookup Keys and Result Field combo boxes.

6.      Choose from the Key Fields drop-down list a field in the current dataset for which to match values. To match more than one field, enter field names directly instead of choosing from the drop-down list. Separate multiple field names with semicolons.
7.      Choose from the Lookup Keys drop-down list a field in the lookup dataset to match against the Source Fields field you specified in step 6. To specify more than one field, enter field names directly instead. Separate multiple field names with semicolons.

8.      Choose from the Result Field drop-down list a field in the lookup dataset to return as the value of the lookup field you are creating. To return values from more than one field in the lookup dataset, enter field names directly instead. Separate multiple field names with semicolons.

Hope this helps
Hi Asi, I send you an example. Weired that it's not working - I just did the usual stuff.

In the example: "Size" has and attached drop down list with values 1-7.

Hope I got you right

asiAuthor Commented:
i did it by the pickup list this is NOT a lookup field ...

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

asiAuthor Commented:
i meant u did it by the pick list and this is not Lookup field which mean that the value in the drop down list is taken from another table

happy fro others unswer
all the best
Uh, Sorry, I'll try to make an example with a lookup field...
asiAuthor Commented:
actually , i find out myself the problem , somehow the look up field have to be long integer
and not short
i have no clue why it is hapend but it solve me the problem
any way 4 your try i"m giving u the points
all the best

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.