Back to Devexpress

InvalidItemExceptionArgs.ExceptionMode Property

corelibraries-devexpress-dot-mvvm-dot-xpf-dot-invaliditemexceptionargs.md

latest3.1 KB
Original Source

InvalidItemExceptionArgs.ExceptionMode Property

Gets or sets how to handle an exception.

Namespace : DevExpress.Mvvm.Xpf

Assembly : DevExpress.Mvvm.v25.2.dll

NuGet Packages : DevExpress.Mvvm, DevExpress.Win.Navigation

Declaration

csharp
public ExceptionMode ExceptionMode { get; set; }
vb
Public Property ExceptionMode As ExceptionMode

Property Value

TypeDescription
ExceptionMode

A value that specifies how to handle an exception.

|

Available values:

NameDescription
DisplayError

Displays an error message box with text specified by the ErrorText property. Use the WindowCaption property to specify the message box’s caption.

| | ThrowException |

Throws an exception. Use the Exception property to get this exception.

| | NoAction |

Displays an error icon and does not allow users to focus other rows until values are corrected.

| | Ignore |

Ignores an exception.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ExceptionMode property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-data-grid-validate-data-rows/CS/ValidateRow_MVVM/MainViewModel.cs#L72

csharp
public void InvalidRow(InvalidRowExceptionArgs args) {
    args.ExceptionMode = ExceptionMode.NoAction;
}

wpf-data-grid-validate-data-rows/VB/ValidateRow_MVVM/MainViewModel.vb#L63

vb
Public Sub InvalidRow(ByVal args As InvalidRowExceptionArgs)
    args.ExceptionMode = ExceptionMode.NoAction
End Sub

See Also

InvalidItemExceptionArgs Class

InvalidItemExceptionArgs Members

DevExpress.Mvvm.Xpf Namespace