Back to Devexpress

InvalidRowExceptionEventArgs.ExceptionMode Property

wpf-devexpress-dot-xpf-dot-grid-dot-invalidrowexceptioneventargs-a5c26180.md

latest3.5 KB
Original Source

InvalidRowExceptionEventArgs.ExceptionMode Property

Gets or sets a value that specifies how an exception should be handled.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

Property Value

TypeDescription
ExceptionMode

An ExceptionMode enumeration value that specifies how an exception should be handled.

|

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 and raises RowCanceled.

|

Remarks

Use the ExceptionMode property to specify the action performed when a row fails validation. You can display a message box with an error description, suppress an action, throw an exception, or ignore the validation result.

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_CodeBehind/MainWindow.xaml.cs#L65

csharp
void OnInvalidRowException(object sender, InvalidRowExceptionEventArgs e) {
    e.ExceptionMode = ExceptionMode.NoAction;
}

wpf-data-grid-validate-data-rows/VB/ValidateRow_CodeBehind/MainWindow.xaml.vb#L55

vb
Private Sub OnInvalidRowException(ByVal sender As Object, ByVal e As InvalidRowExceptionEventArgs)
    e.ExceptionMode = ExceptionMode.NoAction
End Sub

See Also

InvalidRowExceptionEventArgs Class

InvalidRowExceptionEventArgs Members

DevExpress.Xpf.Grid Namespace