Back to Devexpress

ValidationEventArgs.ErrorContent Property

wpf-devexpress-dot-xpf-dot-editors-dot-validationeventargs-01b1295d.md

latest2.7 KB
Original Source

ValidationEventArgs.ErrorContent Property

Gets or sets an object that describes the validation error.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public object ErrorContent { get; set; }
vb
Public Property ErrorContent As Object

Property Value

TypeDescription
Object

An object that represents the validation error’s content.

|

Remarks

Use the ErrorContent property to describe the validation error. This description is displayed within an error tooltip:

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ErrorContent 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-cell-editors/CS/ValidateCell_CodeBehind/MainWindow.xaml.cs#L38

csharp
e.ErrorType = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical;
e.ErrorContent = discount < 0
    ? $"The price cannot be greater than {cellValue}"

wpf-data-grid-validate-cell-editors/VB/ValidateCell_CodeBehind/MainWindow.xaml.vb#L43

vb
e.ErrorType = DevExpress.XtraEditors.DXErrorProvider.ErrorType.Critical
    e.ErrorContent = If(discount < 0, $"The price cannot be greater than {cellValue}", $"The discount cannot be greater than 30% ({cellValue * 0.7}). Please correct the price.")
End Sub

See Also

ValidationEventArgs Class

ValidationEventArgs Members

DevExpress.Xpf.Editors Namespace