How to support a DBLookupComboBox in TCRDBGrid?
Posted: Wed 15 Jan 2014 23:02
How to support a DBLookupComboBox in TCRDBGrid?
I am using Delphi Xe2 with a TCRDBGrid and I am trying to have it contain a drop down list (DBLookupComboBox).
Background
I've got a Product table that relies heavily on a number of related lookup tables (country, state/province, units (lbs,oz,gr,kg), product_type, etc.) and my customer wants to be able to edit the table within the grid.
I was hoping the TCRDBGrid might have some built in support for something like this (embedding a tDBLookupComboBox), but if it does I didn't see it.
Attempted Resolution
So I tried to implement a solution documented in AboutDelphi.com's article Drop down list (DBLookupComboBox) inside a DBGrid
http://delphi.about.com/od/usedbvcl/l/aa101403b.htm
While it works the problem is that once the DBLookupComboBox is visible if you scroll the field synced with the combobox off the visible area for the grid - the combobox still stays visible and is parked on the edge of the grid.
Is there a way to determine when a DBGrid cell is onscreen or offscreen?
If so I could close the DBLookupComboBox via code when the cell in question is not showing.
Also wondering if there is an easier way to do this embedded DBLookupComboBox thing.
Do you have any suggestions?
Thanks...
I am using Delphi Xe2 with a TCRDBGrid and I am trying to have it contain a drop down list (DBLookupComboBox).
Background
I've got a Product table that relies heavily on a number of related lookup tables (country, state/province, units (lbs,oz,gr,kg), product_type, etc.) and my customer wants to be able to edit the table within the grid.
I was hoping the TCRDBGrid might have some built in support for something like this (embedding a tDBLookupComboBox), but if it does I didn't see it.
Attempted Resolution
So I tried to implement a solution documented in AboutDelphi.com's article Drop down list (DBLookupComboBox) inside a DBGrid
http://delphi.about.com/od/usedbvcl/l/aa101403b.htm
While it works the problem is that once the DBLookupComboBox is visible if you scroll the field synced with the combobox off the visible area for the grid - the combobox still stays visible and is parked on the edge of the grid.
Is there a way to determine when a DBGrid cell is onscreen or offscreen?
If so I could close the DBLookupComboBox via code when the cell in question is not showing.
Also wondering if there is an easier way to do this embedded DBLookupComboBox thing.
Do you have any suggestions?
Thanks...