Infragistics2.Win.UltraWinTree.v8.1
CellValidationError Event
See Also  Example
Infragistics.Win.UltraWinTree Namespace > UltraTree Class : CellValidationError Event

Fires when the result of an edit mode session is committed, and the cell�s contents are invalid.

Syntax

Visual Basic (Declaration) 
Public Event CellValidationError() As CellValidationErrorEventHandler
C# 
public event CellValidationErrorEventHandler CellValidationError()

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 BasicCopy 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