Fires when the result of an edit mode session is committed, and the cell�s contents are invalid.
Syntax
Example
The following code sample demonstrates how to use the CellValidationError event to apply a default value to a cell when the user enters invalid data:
For an overview of how to handle events in Visual Basic or Visual C#, see
Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see
Consuming Events in the
.NET Framework Developer's Guide.
| Visual Basic | Copy Code |
|---|
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTree
Private Sub ultraTree1_CellValidationError(ByVal sender As Object, ByVal e As CellValidationErrorEventArgs) Handles ultraTree1.CellValidationError
If e.Column.DataType Is GetType(Integer) Then
e.RaiseDataErrorEvent = False
e.RestoreOriginalValue = False
e.StayInEditMode = False
e.Cell.Value = 0
End If
End Sub
|
| C# | Copy Code |
|---|
using Infragistics.Win; using Infragistics.Win.UltraWinTree; using System.Diagnostics;
private void ultraTree1_CellValidationError(object sender,
Infragistics.Win.UltraWinTree.CellValidationErrorEventArgs e)
{
if ( e.Column.DataType ==
typeof(int) )
{
e.RaiseDataErrorEvent = false;
e.RestoreOriginalValue = false;
e.StayInEditMode = false;
e.Cell.Value = 0;
}
} |
See Also