Skip to main content
All docs
V24.1

TokenEditToken(Object) Constructor

Initializes a new instance of the TokenEditToken class with specified settings.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public TokenEditToken(
    object tokenValue
)

Parameters

Name Type Description
tokenValue Object

The token value. Token values must be unique. This value is assigned to the Value property.

Remarks

Unbound Mode

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();

Bound Mode

  1. Use the Properties.DataSource property to bind the TokenEdit control to a data source.
  2. Use the Properties.DisplayMember to specify the data field that stores token descriptions.
  3. Use the Properties.ValueMember to specify the field that stores token values. Token values must be unique.
tokenEdit1.Properties.BeginUpdate();
tokenEdit1.Properties.DataSource = queryBindingSource;
tokenEdit1.Properties.DisplayMember = "EmailAddress";
tokenEdit1.Properties.ValueMember = "EmailAddressID";
tokenEdit1.Properties.EndUpdate();

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the TokenEditToken(Object) constructor.

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