Back to Devexpress

RowCellValidationArgs.OldValue Property

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

latest2.5 KB
Original Source

RowCellValidationArgs.OldValue Property

Gets the cell’s old valid value.

Namespace : DevExpress.Mvvm.Xpf

Assembly : DevExpress.Mvvm.v25.2.dll

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

Declaration

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

Property Value

TypeDescription
Object

The cell’s old valid value.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the OldValue 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#L35

csharp
return;
var cellValue = (double)args.OldValue;
var discount = 100 - Convert.ToDouble(args.NewValue) / cellValue * 100;

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

vb
If Not Equals(args.FieldName, NameOf(Product.UnitPrice)) OrElse Not CType(args.Item, Product).Discontinued Then Return
Dim cellValue = CDbl(args.OldValue)
Dim discount = 100 - Convert.ToDouble(args.NewValue) / cellValue * 100

See Also

RowCellValidationArgs Class

RowCellValidationArgs Members

DevExpress.Mvvm.Xpf Namespace