Throwing exception from RowChanging event handler

D

Donna

I've followed the Visual Studio .Net documentation and written a
DataTable.RowChanging event handler which throws an exception if the row has
invalid data.
My exception message is displayed nicely in a message dialog and does not
allow the user to leave the row until they fix the error or cancel the edit.

The problem is that the exception is not being caught if the user leaves the
grid without first moving to another row in the grid.

Where is the exception in the RowChanging event being handled?
Can I call this from my code?

Thanks,
Donna.
 
K

Kathleen Dollard

Donna,

Try calling the EndCurrentEdit method if it has one. If not, you'll need to
get a hold of the textbox actually used for editng and call its
EndCurentEdit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top