Back to Devexpress

RowCellValidationArgs.NewValue Property

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

latest2.4 KB
Original Source

RowCellValidationArgs.NewValue Property

Gets the editor’s value.

Namespace : DevExpress.Mvvm.Xpf

Assembly : DevExpress.Mvvm.v25.2.dll

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

Declaration

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

Property Value

TypeDescription
Object

The editor’s value.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the NewValue 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_MVVM/MainViewModel.cs#L36

csharp
var cellValue = (double)args.OldValue;
var discount = 100 - Convert.ToDouble(args.NewValue) / cellValue * 100;
if(discount > 0 && discount <= 30)

wpf-data-grid-validate-cell-editors/VB/ValidateCell_MVVM/MainViewModel.vb#L43

vb
Dim cellValue = CDbl(args.OldValue)
Dim discount = 100 - Convert.ToDouble(args.NewValue) / cellValue * 100
If discount > 0 AndAlso discount <= 30 Then Return

See Also

RowCellValidationArgs Class

RowCellValidationArgs Members

DevExpress.Mvvm.Xpf Namespace