 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guillem Guest
|
Posted: Thu Nov 27, 2003 3:43 pm Post subject: Defining a look-up field in a DBGrid... |
|
|
Hi!
How can I define a look-up field in a TDBGrid at run-time? I know I can do
it at design time but I need to do it at execution time (before populating
the grid).
Any suggestions? Thanks in advance!
Guillem
|
|
| Back to top |
|
 |
Quasidata Guest
|
Posted: Fri Nov 28, 2003 5:38 am Post subject: Re: Defining a look-up field in a DBGrid... |
|
|
Hello Guillem,
Depends whether there are persistent columns created at design time or
they are created dynamically at the moment when you populating your grid.
Dynamic columns do not exist until you open the dataset, they are created
automatically based on fields in the underlying dataset. You can find a
column by iterating through MyDBGrid.Columns[] and looking for the
column's FieldName property value.
It depends also on whether you need to populate the pick list with
external values or to use values from an existing lookup field. In the
later case, you do not need to do anything. In the former case, find the
column by the FieldName value and add values to its PickList property by
code, like
MyDBGrid.Columns[MyColumnIndex].PickList.Add('MyValue');
Also, see topic in the help file
Developing Database Applications -> Using Data Controls -> Defining a
lookup list column
--
Andrei Fomine www.quasidata.com
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@Once - full-blown clipboard and drag-and-drop data transfer
to/from any control in many formats, including ones native to MS Office.
"Guillem" <keinname (AT) eresmas (DOT) net> wrote
| Quote: | Hi!
How can I define a look-up field in a TDBGrid at run-time? I know I can
do
it at design time but I need to do it at execution time (before
populating
the grid).
Any suggestions? Thanks in advance!
Guillem
|
|
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum
|
|