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.v20.1.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(false)]
public virtual bool ValidateOnEnterKey { get; set; }
<DXCategory("Behavior")>
<DefaultValue(False)>
Public Overridable Property ValidateOnEnterKey As Boolean

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.

See Also