Back to Devexpress

RepositoryItemTextEdit.ValidateOnEnterKey Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtextedit-bf0e779f.md

latest3.7 KB
Original Source

RepositoryItemTextEdit.ValidateOnEnterKey Property

Gets or sets whether to raise the RepositoryItem.Validating event on pressing the ENTER key.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDefaultDescription
Booleanfalse

true to raise the RepositoryItem.Validating event on pressing the ENTER key; otherwise, false.

|

Remarks

Set the editor’s CausesValidation property to true to enable input validation (and raise the RepositoryItem.Validating event). If the ValidateOnEnterKey property is set to false, validation occurs only when the focus moves to another control.

Note

Popup (dropdown) editors raise the Validating event on pressing the ENTER key if their edit box is focused. A popup editor does not raise the Validating event when the ENTER key is pressed if the focus is in the dropdown.

The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.

how-to-use-the-processnewvalue-event-of-a-lookup-editor-e285/CS/Form1.cs#L36

csharp
LookUpEdit1.Properties.DropDownRows = 20;
LookUpEdit1.Properties.ValidateOnEnterKey = true;

how-to-use-the-processnewvalue-event-of-a-lookup-editor-e285/VB/Form1.vb#L38

vb
LookUpEdit1.Properties.DropDownRows = 20
LookUpEdit1.Properties.ValidateOnEnterKey = True
LookUpEdit1.Properties.SearchMode = DevExpress.XtraEditors.Controls.SearchMode.OnlyInPopup

See Also

Validating

RepositoryItemTextEdit Class

RepositoryItemTextEdit Members

DevExpress.XtraEditors.Repository Namespace