Skip to main content
All docs
V24.2

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>.Columns Property

Allows you to add columns to the TagBox.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public RenderFragment Columns { get; set; }

#Property Value

Type Description
RenderFragment

A collection of columns (UI fragments).

#Remarks

The TagBox control can display data across multiple columns. Follow the steps below to create columns:

  1. Add a <Columns> tag to the component’s markup to declare the column collection.
  2. Populate the Columns collection with DxListEditorColumn objects. These objects include the following properties:

    • Caption - Specifies the column’s caption text.
    • FieldName - Specifies the data source field that populates column items in multi-column editors.
    • SearchEnabled - Specifies whether the component can search text in cells of the current column.
    • Visible - Specifies whether the column is visible.
    • VisibleChanged - Fires when the column visibility changes.
    • VisibleIndex - Specifies a column’s position among other columns.
    • VisibleIndexChanged - Fires when the column’s visible index changes.
    • Width - Specifies the column’s width.

To format tag values, use the EditFormat property.

@using StaffData

<DxTagBox Data="@Staff.DataSource"
          @bind-Values="@SelectedStaff"
          EditFormat="{1} {2}">
    <Columns>
        <DxListEditorColumn FieldName="Id" Width="50px" />
        <DxListEditorColumn FieldName="FirstName" Caption="Name"/>
        <DxListEditorColumn FieldName="LastName" Caption="Surname"/>
    </Columns>
</DxTagBox>

@code {
    IEnumerable<Person> SelectedStaff { get; set; } = new List<Person>() { Staff.DataSource[0] };
}

TagBox - Multiple Columns

Run Demo: TagBox – Multiple Columns

See Also