Discussion:
Datagridview event order
(too old to reply)
Derek
2008-11-04 16:55:01 UTC
Permalink
I am trying to validate data input in a datagridview.

It is throwing an error about a column not allowing Null values somewhere
between RowValidating and RowStateChanged. It is not in RowValidated, I have
a debug message in there.

Does anyone know the order of events when you move from one row of a
datagridview to another?
--
Derek
James
2008-12-17 23:39:00 UTC
Permalink
Hi Derek,
It's probably too late for this post, but maybe it will be useful to someone
else.
I was having an issue with setting the CurrentCell in the DataError event so
I wrote the event order out to a file.

When entering a cell
RowEnter
CellEnter
CellBeginEdit Only occurs if cell enters edit mode.


When leaving a cell
CellLeave
RowLeave
CellValidating
CellParsing Only occurs if a cell is in edit mode
CellValidated
RowValidating
RowValidated
CellStateChanged
CellStateChanged
CellEndEdit Only occurs if a cell is in edit mode.
RowStateChanged As far as I can tell, this only occurs if you change the
state
of row, ie. by selecting the whole row.
RowEnter
DataError Only occurs if there was an error committing the data
back to the DataSource.
CellEnter
Post by Derek
I am trying to validate data input in a datagridview.
It is throwing an error about a column not allowing Null values somewhere
between RowValidating and RowStateChanged. It is not in RowValidated, I have
a debug message in there.
Does anyone know the order of events when you move from one row of a
datagridview to another?
--
Derek
Loading...