Skip to main content
A newer version of this page is available. .

RepositoryItemTextEdit.ValidateOnEnterKey Property

Gets or sets whether to invoke the RepositoryItem.Validating event when pressing the ENTER key.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(false)]
public virtual bool ValidateOnEnterKey { get; set; }

Property Value

Type Default Description
Boolean **false**

true if the RepositoryItem.Validating event is raised when the ENTER key is pressed; otherwise, false.

Remarks

If the property value is false, validation occurs only when moving focus to another control. Set the editor’s CausesValidation property to true to allow validation (and raise the RepositoryItem.Validating event).

The RepositoryItem.Validating event can be handled if you need to provide a custom constraint for the edit value. For instance, you can check whether the text entered only contains appropriate characters or that a numeric value falls within a particular range etc. The event handler can keep focus within the editor and also lets you display an explanatory message about the error.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ValidateOnEnterKey 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.

See Also