Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomEdit.ValidateEdit Method

Validates the display value of an editor.

#Declaration

Delphi
function ValidateEdit: Boolean; overload;

#Returns

Type
Boolean

#Remarks

By entering a value into an editor, an end-user actually changes the display value (not the edit value). Before converting the display value to the edit value it needs to be validated. The ValidateEdit function performs validation, and if it succeeds, the function converts the display value to the edit value, and then returns True. Otherwise, False is returned and the edit value remains unchanged.

The ValidateEdit function performs necessary validations by making a call to the Properties.ValidateDisplayValue method. This method fires the Properties.OnValidate event, enabling you to customize (override) validation results.

If validation fails and True is passed as the ARaiseExceptionOnError parameter, the ValidateEdit function throws an exception (as if the evoRaiseException flag is set within the editor’s Properties.ValidationOptions property). Otherwise, no exception is thrown, which may be useful when you want to safely (quietly) validate the display value.

If validation succeeds, the editor’s Properties.OnEditValueChanged event is generated and a new edit value is assigned to the EditValue property.

See Also