Skip to main content

DXCollectionView.ValidateAndSave Event

Allows you to validate data item values before they are committed to the data source.

Namespace: DevExpress.Maui.CollectionView

Assembly: DevExpress.Maui.CollectionView.dll

NuGet Package: DevExpress.Maui.CollectionView

Declaration

public event EventHandler<ValidateItemEventArgs> ValidateAndSave

Event Data

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

Property Description
AutoUpdateItemsSource Gets or sets whether the data source associated with the validation context updates automatically when the validation is successful. This is a bindable property.
Context Gets the context or metadata associated with the validation event.
DataChangeType Gets the type of changed data.
IsValid Gets or sets whether the item is valid. This is a bindable property.
IsValidAsync Gets or sets whether the validated item meets the criteria. This is a bindable property.
Item Gets the item validated in the event.
SourceIndex Gets the index of the validated item in the data source.

The event data class exposes the following methods:

Method Description
ForceUpdateItemsSource() Updates the item data source to reflect any changes during validation.

Remarks

The DXCollectionView runs validation mechanisms after a user taps the Save button in the edit form in a built-in detail form or after you call the DetailEditFormViewModel.SaveAsync() method for a custom form.

See Also