I am using XtraGrid with LINQ2SQL as a datasource and I'm having some problems.
Sometimes data validation errors occur while posting changes in database (say in case of unique index violation or trigger error or FK doent exist or you try to delete someone's parent etc). In this case, I need to notify user and make him able to correct data or revert row.
Unfortunately, I was not able to find the best place to put code and make it possible.
Inside GridView.ValidateRow event body no underlying data has been changed yet (and no changes will be caused by dataContext.SubmitChanges() call).
The GridView.RowUpdated event looks like a good place for saving changes to DB, but i'm unable to keep the error row focused (if user caused row update by moving focus to another row then the focus will go away after this event handler completion).
What is the common solution to handle database errors while insert/update/delete operations in GridView?