dbgrid and lookup

Posted on 1998-06-21
Last Modified: 2010-04-04
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

Question by:asi
  • 3
  • 3

Expert Comment

ID: 1354735
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


Author Comment

ID: 1354736
i did it by the pickup list this is NOT a lookup field ...


Author Comment

ID: 1354737
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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.


Expert Comment

ID: 1354738
Uh, Sorry, I'll try to make an example with a lookup field...

Accepted Solution

Matvey earned 50 total points
ID: 1354739
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

Author Comment

ID: 1354740
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


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Intraweb submit form as a POST request 4 322
Delphi cmd execution 6 67
How to renew a Delphi rad-studio licence? 5 69
firemonkey Android Listview Sort items 7 48
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question