Version

CellValidationError Event

Fires when the result of an edit mode session is committed, and the cell’s contents are invalid.
Syntax
'Declaration
 
Public Event CellValidationError As CellValidationErrorEventHandler
public event CellValidationErrorEventHandler CellValidationError
Event Data

The event handler receives an argument of type CellValidationErrorEventArgs containing data related to this event. The following CellValidationErrorEventArgs properties provide information specific to this event.

PropertyDescription
Cell (Inherited from Infragistics.Win.UltraWinTree.CellEventArgs)Returns the UltraTreeNodeCell object for which this instance was created.
Column (Inherited from Infragistics.Win.UltraWinTree.CellEventArgs)Returns the UltraTreeNodeColumn for which this instance was created.
Node (Inherited from Infragistics.Win.UltraWinTree.CellEventArgs)Returns the UltraTreeNode for which this instance was created.
RaiseDataErrorEvent Gets/sets whether the DataError should be raised to report the error to listeners of that event.
RestoreOriginalValue Gets/sets whether the cell's value will be restored to the value it had prior to entering edit mode.
StayInEditMode Gets/sets whether the cell will remain in edit mode, preventing the end user from leaving the cell until a valid value is entered or the edit mode session is canceled.
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.

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
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;
			}
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also