G
Guest
I'm writing a Winforms project in VB/Dot Net 2.0 and I'm having some trouble
handling the Data Error event.
The grid is bound to a filtered binding source. Part of the primary key is
set by one of the cells in the grid which is in combobox mode. Add is
enabled.
What I want to do in DataError is give the user the choice of remaining in
the row to fix it (e.cancel = true) or just dispose of the changes. If it is
an existing row, virtually anything seems to work fine (such as
<bindingsource.ResetBindings, or nothing for that matter.)
What gives me trouble is a newly added row. Any attemp to get rid of the new
row by any means seems to get me into some sort of infinite loop, usually
with errors like 'Index <number> does not have a value'.
Am I even trying to handle the error in the right place? RowValidating
doesn't seem to do anything for index errors.
handling the Data Error event.
The grid is bound to a filtered binding source. Part of the primary key is
set by one of the cells in the grid which is in combobox mode. Add is
enabled.
What I want to do in DataError is give the user the choice of remaining in
the row to fix it (e.cancel = true) or just dispose of the changes. If it is
an existing row, virtually anything seems to work fine (such as
<bindingsource.ResetBindings, or nothing for that matter.)
What gives me trouble is a newly added row. Any attemp to get rid of the new
row by any means seems to get me into some sort of infinite loop, usually
with errors like 'Index <number> does not have a value'.
Am I even trying to handle the error in the right place? RowValidating
doesn't seem to do anything for index errors.