validation in datagrid
-
right now I am dealing with validation errors with this after the data has been processed determining if there is an error
If isValid Then 'will clear the error for the row e.Row.ClearErrors() Else 'prevents the invalid changes from being submitted e.Row.AcceptChanges() End If
It works, just the way that it should, but the logic is odd in that I have to AcceptChanges(). I do understand what is happening, but if someone else who is unaware of what happens in the acceptChanges method they would scratch their head. So is there a better way of doing this? -
right now I am dealing with validation errors with this after the data has been processed determining if there is an error
If isValid Then 'will clear the error for the row e.Row.ClearErrors() Else 'prevents the invalid changes from being submitted e.Row.AcceptChanges() End If
It works, just the way that it should, but the logic is odd in that I have to AcceptChanges(). I do understand what is happening, but if someone else who is unaware of what happens in the acceptChanges method they would scratch their head. So is there a better way of doing this?When invoking AcceptChanges, the EndEdit method is implicitly called to end any edits. If the RowState of the row was Added or Modified, the tee cref="System.Data.DataRow.RowState"/> becomes Unchanged. If the RowState was Deleted, the row is removed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassacceptchangestopic.asp
-
When invoking AcceptChanges, the EndEdit method is implicitly called to end any edits. If the RowState of the row was Added or Modified, the tee cref="System.Data.DataRow.RowState"/> becomes Unchanged. If the RowState was Deleted, the row is removed. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatadatarowclassacceptchangestopic.asp