Back to Devexpress

ValidationEventArgs.Value Property

wpf-devexpress-dot-xpf-dot-editors-dot-validationeventargs-bc19c919.md

latest3.4 KB
Original Source

ValidationEventArgs.Value Property

Gets the editor’s value.

Namespace : DevExpress.Xpf.Editors

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public object Value { get; }
vb
Public ReadOnly Property Value As Object

Property Value

TypeDescription
Object

An object that represents the editor’s value entered by an end-user.

|

Remarks

Use the Value property to obtain the value entered by an end-user. If this value meets your validation rules, leave the ValidationEventArgs.IsValid property set to true. Otherwise, if the Value property’s value is invalid, set the ValidationEventArgs.IsValid property to false. The error type and description can be specified using the ValidationEventArgs.ErrorType and ValidationEventArgs.ErrorContent properties, respectively.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Value 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-bind-to-infiniteasyncsource/CS/InfiniteAsyncSourceSample/MainWindow.xaml.cs#L117

csharp
if(e.IsNewItem) {
    e.UpdateRowResult = IssuesService.AddNewIssueAsync((IssueData)e.Value);
} else {

wpf-data-grid-validate-cell-editors/CS/ValidateCell_CodeBehind/MainWindow.xaml.cs#L32

csharp
var cellValue = (double)e.CellValue;
var discount = 100 - Convert.ToDouble(e.Value) / cellValue * 100;
if(discount > 0 && discount <= 30)

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

vb
Dim cellValue = CDbl(e.CellValue)
Dim discount = 100 - Convert.ToDouble(e.Value) / cellValue * 100
If discount > 0 AndAlso discount <= 30 Then Return

See Also

ValidationEventArgs Class

ValidationEventArgs Members

DevExpress.Xpf.Editors Namespace