I'm using a bound UltraWinGrid to perform table data table entry.
I capture the dg_Error(object sender, ErrorEventArgs e) event to set a RowError msg string if the user tries to create a row with a duplicate key. However, after they correct the information and successfully add a new row to the dg and bound dt, the new row gets inserted showing the RowError msg I created in the dg_Error event.
What event should I use to clear the RowError msg on a new row or an updated row that previously had an error?
Hi Rob,
This is a tricky question to answer without seeing it in action. Off the top of my head, the AfterRowUpdate event seems like a reasonable choice. This event fires after the row has been committed to the underlying data source. So by that point, you can be sure that it can't possible have a duplicate key.
Thanks, that did the trick.
I should have thought of that event, but I assumed it would fire even if there was a data error on the row update. That would have effectively turned off the error msg set for the row in the dg_error event.
But, since I set the the "e.cancel = true;" in the dg_error event, it appears to stop the AfterRowUpdate from firing.