TreeListView.InvalidNodeException Event
Fires when a node fails validation, or when it cannot be saved to a data source.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v20.2.dll
NuGet Packages: DevExpress.WindowsDesktop.Wpf.Grid.Core, DevExpress.Wpf.Grid.Core
Declaration
Event Data
The InvalidNodeException event's data class is TreeListInvalidNodeExceptionEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
ErrorText | Gets or sets the error description. |
Exception | Gets the exception that raised the TreeListView.InvalidNodeException event. |
ExceptionMode | Gets or sets a value that specifies how an exception should be handled. |
Handled | Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs. |
Node | Gets the processed node. Inherited from TreeListNodeEventArgs. |
OriginalSource | Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs. |
RoutedEvent | Gets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs. |
Row | Gets the processed row. Inherited from TreeListNodeEventArgs. |
Source | Gets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs. |
WindowCaption | Gets or sets the error window’s caption. |
The event data class exposes the following methods:
Method | Description |
---|---|
InvokeEventHandler(Delegate, Object) | When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs. |
OnSetSource(Object) | When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs. |
Remarks
Node validation is performed within the TreeListView.ValidateNode event handler, when a node is about to lose focus. The InvalidNodeException event allows you to override the default error presentation. This event occurs after the TreeListView.ValidateNode event (provided that the focused node’s validation has failed).
Use the event parameter’s TreeListInvalidNodeExceptionEventArgs.ExceptionMode property, to specify the action performed in response to entering an invalid value. You can display a message box with an error description, suppress any action, throw an exception or discard new data and revert to an old value.
To learn more, see Row Validation.