Dale
The first drop down combo box for the data grid was written by Mark Boulter
and converted to VB by yours truly using Beta1 after we could not get it to
work in the PDC Tech Preview version.  It's done my heart good to see it
appear on the net with a million other authors -- after all plagerism is
the most sincere form of flattery. <grin>

I digress..

The problem with doing this in Current Cell changed (firing the column
changed event directly from the presentation) is that this approach works
great until you are in a new row.  The new row exists in a "detached"
state -- it is created by the grid control and does not become a member of
the underlying data table until the grid control sends it to the
binding/currency manager, who in turn adds the row.  In order to fire
column changing, you need a pointer to the row passed in the
DataColumnChangeEventArgs -- particularly if you have validation where cell
A and cell B interact.  A large number of our application grids are
essentially query writers that resolve to a WHERE clause; given the size of
the database tables the front end needs to perform some basic lexical
analysis on the data in the grid before sending it off to the database
engine.

It's the architecture of the whole data grid/currency manager/data table
that causes ths problem; hence my desire to implement my own version of the
data grid column style.  A data grid text box/drop down/boolean column does
not get mated to the grid cell until the grid cell goes into edit mode, and
this does not occur until the user actually types something.  Once the grid
cell is in edit mode the events sink down through the component layers and
you end up in column changing.  Trouble is, when the user tabs through the
cell, edit mode is never started in the first place.

We've tried just about anything and everything in order to solve this
problem to no avail.  Sure there are third party grid controls, but at this
juncture redesigning literally hundreds of forms to use a new grid does not
justify this little feature -- but the end users keep whining.

If someone has a direct line to the internals of a data grid column style
object then I suspect we could change the way that edit mode is invoked
through subclassing but all attempts to date have been a failure.

Alan Robbins

Reply via email to