Board index » delphi » lookupComboBox in dbGrid

lookupComboBox in dbGrid

Is there anyway to create a lookupcombobox in a dbGrid cell?
 

Re:lookupComboBox in dbGrid


Sure,

Create a LookupField in the dataset your grid is pointing to.

Alfred.

"George Kuascha" <gkho...@hotmail.com> schreef in bericht
news:3b4a2070$1_2@dnews...

Quote
> Is there anyway to create a lookupcombobox in a dbGrid cell?

Re:lookupComboBox in dbGrid


Quote
>Is there anyway to create a lookupcombobox in a dbGrid cell?

If you have a lookupfield defined for a table a dbGrid will by default treat
that field as a combobox.   This only works properly when your lookup field is
linked on a single field.

The other alternative is to put a Tdblookupcombobox on your form with its
visible property set to false.  Then with the grids OnDrawDataCell event when
the field is the field to use the dblookupcombox in set the Top,left, width and
height to match the column cell and turn on the visible property.
You also need code in the OnColExit event to set the dblookupcombo visible
property back to false
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads