Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTagBox<TData, TValue>.Tags Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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.

razor
<DxTagBox Data="@Cities"
          NullText="Select city..."
          TData="string"
          TValue="string"
          AllowCustomTags="true"
          @bind-Tags="@Tags"
          ClearButtonDisplayMode="DataEditorClearButtonDisplayMode.Auto"/>

@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

#Implements

DevExpress.Blazor.ITagBox<TData, TValue>.Tags
See Also