Skip to main content

TokenEdit.SelectedItems Property

Gets the collection that contains all tokens currently visible within the editor.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[Browsable(false)]
public TokenEditSelectedItemCollection SelectedItems { get; }

Property Value

Type Description
DevExpress.XtraEditors.TokenEditSelectedItemCollection

A DevExpress.XtraEditors.TokenEditSelectedItemCollection object that contains all tokens currently visible within the editor.

Remarks

The SelectedItems object provides zero-based indexed access to all tokens currently displayed within the editor, whether they were chosen from the drop-down list (see the RepositoryItemTokenEdit.ShowDropDown property) or manually entered and transformed into tokens in the RepositoryItemTokenEdit.ValidateToken event. In other words, the SelectedItems property returns the collection of all tokens whose values (TokenEditToken.Value) form the editor’s current EditValue property value.

The same tokens can be also retrieved within an IList structure via the TokenEdit.GetTokenList method.

Important

Do not confuse the SelectedItems property with the TokenEdit.CheckedItems property, which returns all tokens painted as checked. To check a token, an end-user must click its caption.

The SelectedItems collection is designed only to return visible tokens. Do not manually modify this collection via Add, AddRange, Remove or other methods. Use the TokenEdit.SelectItem or TokenEdit.RemoveItem methods instead.

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

See Also