Back to Devexpress

RepositoryItemTokenEdit.EditMode Property

windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitemtokenedit-f360937c.md

latest4.2 KB
Original Source

RepositoryItemTokenEdit.EditMode Property

Gets or sets whether an end-user can manually enter and validate any desired text within this TokenEdit.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(TokenEditMode.Default)]
[DXCategory("Behavior")]
public TokenEditMode EditMode { get; set; }
vb
<DXCategory("Behavior")>
<DefaultValue(TokenEditMode.Default)>
Public Property EditMode As TokenEditMode

Property Value

TypeDefaultDescription
DevExpress.XtraEditors.TokenEditModeDefault

A DevExpress.XtraEditors.TokenEditMode enumerator value that specifies whether an end-user can manually enter and validate any desired text within this TokenEdit.

|

Remarks

Depending on the EditMode property value, the TokenEdit control can operate in either Manual or Token List mode.

  • In Manual mode, end-users can manually enter any text that will later be validated in the RepositoryItemTokenEdit.ValidateToken event. If the entered text does not pass this validation, it remains plain text. Otherwise, it is converted into a token. In this mode, the token drop-down list (see the RepositoryItemTokenEdit.ShowDropDown property) is used only as a secondary tool that assists your end-users in entering tokens that were either added previously, or stored in the predefined RepositoryItemTokenEdit.Tokens collection.
  • In Token List mode (same as Default value), end-users can only type in tokens stored within the RepositoryItemTokenEdit.Tokens collection. Any text that does not match these stored tokens is automatically deleted. The RepositoryItemTokenEdit.ValidateToken event is never raised, since end-users are allowed to select only pre-defined tokens and no validation is needed.

See the Token Edit Control topic for the details.

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

winforms-tokenedit-checked-tokens/CS/TokenEdit_Glyph_InEndOfToken/Form1.cs#L31

csharp
edit.Separators.AddRange(new string[] { "," });
edit.EditMode = TokenEditMode.Manual;
edit.ValidateToken += tokenEdit1_ValidateToken;

See Also

Token Edit Control

RepositoryItemTokenEdit Class

RepositoryItemTokenEdit Members

DevExpress.XtraEditors.Repository Namespace