Board index » delphi » Lookup/link in TDBGrid

Lookup/link in TDBGrid

I want to display detail of a coded entry in a TDBGrid.   eg if a field in
the displayed table (Table1) has value 1, show "Fred", 2, show "George" etc.
I have these links in a separate table (Table2) which is configured for
Master/Detail operation to the appropriate field in Table1.   Master/Detail
does not appear to help though when drawing the grid, as the Detail table
does not track through the OnDrawColumnCell event.

I suppose I could have a case statement in OnDrawColumnCell event to catch
the column, and lookup the expanded text, but that sounds "messy".

Does anyone have any suggestions on how to go about this?

Thanks.
Andrew Spencer

 

Re:Lookup/link in TDBGrid


You need create a Lookup-field for your Table1:
1. select a Table1 component
2. double click for Fields Editor showing
3. press a right mouse button and select a New field
4. in dialog select a Lookup type and fill all edit boxes

PS: you must post messages like that in Database's forums

--
With best regards, Mike Shkolnik.
FIDO: 2:463/106.14
E-Mail: mshkol...@rs-ukraine.kiev.ua
        m...@woccu.freenet.kiev.ua
WEB: http://www.geocities.com/SiliconValley/Grid/3989

Andrew Spencer D??? ???Y?? <7pb6c7$r...@forums.borland.com> ...

Quote
>I want to display detail of a coded entry in a TDBGrid.   eg if a field in
>the displayed table (Table1) has value 1, show "Fred", 2, show "George"
etc.
>I have these links in a separate table (Table2) which is configured for
>Master/Detail operation to the appropriate field in Table1.   Master/Detail
>does not appear to help though when drawing the grid, as the Detail table
>does not track through the OnDrawColumnCell event.

>I suppose I could have a case statement in OnDrawColumnCell event to catch
>the column, and lookup the expanded text, but that sounds "messy".

>Does anyone have any suggestions on how to go about this?

>Thanks.
>Andrew Spencer

Other Threads