Back to Devexpress

DialogEditFormBehavior.ValidateRow Event

wpf-devexpress-dot-xpf-dot-grid-dot-dialogeditformbehavior-45a23a0c.md

latest3.5 KB
Original Source

DialogEditFormBehavior.ValidateRow Event

Occurs after a user saves changes made in the dialog edit form. This event allows you to validate values, check database constraints, and save changes to the database.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Extensions.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public event EventHandler<EditFormRowValidationArgs> ValidateRow
vb
Public Event ValidateRow As EventHandler(Of EditFormRowValidationArgs)

Event Data

The ValidateRow event's data class is EditFormRowValidationArgs. The following properties provide information specific to this event:

PropertyDescription
CancellationTokenGets a token that allows you to respond to a task cancellation request invoked by the GridControl.
EditOperationContextGets the edit operation’s data context.
IsNewItemGets whether the dialog edit form was invoked to add a new item to the GridControl.
ItemGets the processed data record.
ValidateAsyncGets or sets the task that validates changes and posts them to the data source.

Remarks

After a user saves changes made in the dialog edit form , the behavior raises the ValidateRow event and executes the ValidateRowCommand.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ValidateRow event.

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-implement-crud-operations/CS/CodeBehind/EntityFramework/InstantFeedbackMode/MainWindow.xaml#L47

xml
<dxg:DialogEditFormBehavior x:Name="EditFormBehavior" KeyProperty="Id"
                            CreateEditItemViewModel="OnCreateEditEntityViewModel" ValidateRow="OnValidateRow"
                            ValidateRowDeletion="OnValidateRowDeletion">

See Also

DialogEditFormBehavior Class

DialogEditFormBehavior Members

DevExpress.Xpf.Grid Namespace