wpf-devexpress-dot-xpf-dot-editors-dot-validationeventargs-01b1295d.md
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
public object ErrorContent { get; set; }
Public Property ErrorContent As Object
| Type | Description |
|---|---|
| Object |
An object that represents the validation error’s content.
|
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
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
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