wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-aebb62c5.md
Occurs when a node fails validation or cannot be saved to a data source.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public event TreeListInvalidNodeExceptionEventHandler InvalidNodeException
Public Event InvalidNodeException As TreeListInvalidNodeExceptionEventHandler
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. |
Use the TreeListView.ValidateNode event to validate entered values. After this event is handled, the InvalidNodeException event occurs and allows you to specify how to display validation errors.
Use the TreeListInvalidNodeExceptionEventArgs.ExceptionMode property to specify which action to perform when a user enters an invalid value. You can display a message box with an error description, suppress an action, throw an exception, or ignore the validation result.
If you want to maintain a clean MVVM pattern and specify an error presentation in a View Model, create a command and bind it to the InvalidNodeExceptionCommand property.
Refer to the following help topic for more information: Row Validation.
See Also