Skip to main content
A newer version of this page is available. .

DxTagBox<TData, TValue>.Tags Property

Specifies strings (tags) displayed within the TagBox edit box.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public IEnumerable<string> Tags { get; set; }

Property Value

Type Description
IEnumerable<String>

An IEnumerable<T> collection that stores textual representations of the editor’s values.

Remarks

The Tags property provides access to the <DxTagBox> edit box’s strings. The collection contains textual presentations of the selected data items (Values) and custom tags (if AllowCustomTags is set to true).

To handle changes to the Tags collection, use the TagsChanged event.

<DxTagBox Data="@Cities"
          TData="string"
          TValue="string"
          AllowCustomTags="true"
          @bind-Tags="Tags"
          HideSelectedItems="false">
</DxTagBox>

@code {
    IEnumerable<string> Cities { get; set; } = new List<string>() {
        "London",
        "Berlin",
        "Paris",
    };

    IEnumerable<string> Tags { get; set; } = new List<string>() {
        "London",
        "New York"
    };
}

TagBox Custom Tags

If the value of the Tags collection’s item is equal to a TagBox drop-down window’s item, the corresponding item is hidden from the list. To display and automatically select the item in the drop-down list, set the HideSelectedItems property to false.

Run Demo: TagBox - Show Selected Items

See Also