windowsforms-devexpress-dot-xtraeditors-d955e495.md
The text editor that applies custom validation to the entered text and transforms text blocks which passed this validation to tokens.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXLicenseWinFormsEditors]
public class TokenEdit :
BaseEdit,
IPopupControl,
IPopupControlHookPopupFactory,
IMouseWheelSupport,
IDXMenuSupport,
ITextEditControllerOwner,
IDirectXClientProviderEx,
IDirectXClientProvider,
ISupportsAutoSize
<DXLicenseWinFormsEditors>
Public Class TokenEdit
Inherits BaseEdit
Implements IPopupControl,
IPopupControlHookPopupFactory,
IMouseWheelSupport,
IDXMenuSupport,
ITextEditControllerOwner,
IDirectXClientProviderEx,
IDirectXClientProvider,
ISupportsAutoSize
The following members return TokenEdit objects:
The TokenEdit is an advanced text editor that can apply custom validation logic to the entered text and transform those text blocks that have successfully passed this validation into tokens - visual elements that can display glyphs and fire various events in response to user actions (for example, TokenClick, TokenMouseEnter).
Read the following topic for additional information and examples: Token Edit Control.
In unbound mode, the TokenEdit stores tokens in the Properties.Tokens collection. The following example demonstrates how to add unbound tokens in code:
tokenEdit1.Properties.BeginUpdate();
// Token values must be unique.
tokenEdit1.Properties.Tokens.AddToken("Description string A", "value1");
tokenEdit1.Properties.Tokens.AddToken("Description string B", "value2");
// ... add more tokens
tokenEdit1.Properties.EndUpdate();
tokenEdit1.Properties.BeginUpdate()
' Token values must be unique.
tokenEdit1.Properties.Tokens.AddToken("Description string A", "value1")
tokenEdit1.Properties.Tokens.AddToken("Description string B", "value2")
' ... add more tokens
tokenEdit1.Properties.EndUpdate()
TokenEdit control to a data source.tokenEdit1.Properties.BeginUpdate();
tokenEdit1.Properties.DataSource = queryBindingSource;
tokenEdit1.Properties.DisplayMember = "EmailAddress";
tokenEdit1.Properties.ValueMember = "EmailAddressID";
tokenEdit1.Properties.EndUpdate();
tokenEdit1.Properties.BeginUpdate()
tokenEdit1.Properties.DataSource = queryBindingSource
tokenEdit1.Properties.DisplayMember = "EmailAddress"
tokenEdit1.Properties.ValueMember = "EmailAddressID"
tokenEdit1.Properties.EndUpdate()
Object MarshalByRefObject Component Control DevExpress.XtraEditors.XtraControl ControlBase BaseControl BaseEdit TokenEdit
See Also