void gcMultiRow1_DataError(object sender, DataErrorEventArgs e)
{
// The first id cell only can input number, if user input some invalid value, DataError event will be fired.
// You should handle this event to handle some error cases.
if ((e.Context & DataErrorContexts.Commit) != 0)
{
// When committing value occurs error, show a massage box to notify user, and roll back value.
MessageBox.Show(e.Exception.Message);
EditingActions.CancelEdit.Execute(this.gcMultiRow1);
}
else
{
// Other handle.
}
}
Private Sub gcMultiRow1_DataError(ByVal sender As Object, ByVal e As DataErrorEventArgs) Handles gcMultiRow1.DataError
' The first id cell only can input number, if user input some invalid value, DataError event will be fired.
' You should handle this event to handle some error cases.
If (e.Context And DataErrorContexts.Commit) <> 0 Then
' When committing value occurs error, show a massage box to notify user, and roll back value.
MessageBox.Show(e.Exception.Message)
EditingActions.CancelEdit.Execute(Me.gcMultiRow1)
' Other handle.
Else
End If
End Sub