Skip to main content

BaseEdit.Validate Event

Enables you to validate the editor’s value.

Namespace: DevExpress.WinUI.Editors

Assembly: DevExpress.WinUI.Editors.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

public event ValidateEventHandler Validate

Event Data

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

Property Description
ErrorContent Gets or sets an object that describes the validation error.
ErrorType Gets or sets the error icon type.
IsValid Gets or sets a value which specifies whether the value is valid.
UpdateSource Gets the action that caused the validation.
Value Gets the editor’s value.

The event data class exposes the following methods:

Method Description
SetError(Object, ErrorType) Marks the processed input value as invalid and displays an error within the editor with the specified error icon type.
SetError(Object) Marks the processed input value as invalid and displays an error within the editor.

Remarks

Handle the Validate event to manually validate the editor (e.g. to limit the range of valid values, implement a custom conditional validation mechanism, etc).

To specify when the editor should automatically validate its value, use the BaseEdit.ValidateOnEnterKeyPressed and BaseEdit.ValidateOnTextInput properties. To manually force the editor’s validation, call the BaseEdit.DoValidate method.

Note

The Validate event is not raised if the editor’s BaseEdit.CausesValidation property is set to false.

See Also