S
sherifffruitfly
Hi all,
I've got a datagrid bound to a dataset/table. When the OnRowChanging
event fires, the handler attempts to Insert the new record into the
database. When there's an error with this Insert operation, it gets
trapped (message displayed). The datagrid still displays the bad
record - I'd like to delete the record from the datagrid. All I (think
I) have available to me in the exception handler is the row itself
(Exception ex.Row). When I try ex.row.rejectchanges, I get a runtime
error dialog telling me:
"Cannot call CancelEdit inside an OnRowChanging event. Throw an
exception to cancel this update. Do you want to correct the value?"
How can I get the bad row off of my datagrid?
Thanks for any ideas,
cdj
I've got a datagrid bound to a dataset/table. When the OnRowChanging
event fires, the handler attempts to Insert the new record into the
database. When there's an error with this Insert operation, it gets
trapped (message displayed). The datagrid still displays the bad
record - I'd like to delete the record from the datagrid. All I (think
I) have available to me in the exception handler is the row itself
(Exception ex.Row). When I try ex.row.rejectchanges, I get a runtime
error dialog telling me:
"Cannot call CancelEdit inside an OnRowChanging event. Throw an
exception to cancel this update. Do you want to correct the value?"
How can I get the bad row off of my datagrid?
Thanks for any ideas,
cdj