DxTagBox<TData, TValue>.Columns Property
Allows you to add columns to the TagBox.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v25.1.dll
NuGet Package: DevExpress.Blazor
Declaration
[Parameter]
public RenderFragment Columns { get; set; }
Property Value
Type | Description |
---|---|
RenderFragment | A collection of columns (UI fragments). |
Remarks
The DevExpress Blazor TagBox control can display data across multiple columns. Follow the steps below to create columns:
- Add
<Columns>...</Columns>
tag to the component’s markup to declare the column collection. - Populate the column collection with DxListEditorColumn objects. Each object corresponds to a separate column.
- For each
DxListEditorColumn
object, specify the data source field that populates column cells. - Specify the
DxListEditorColumn
properties to customize the column’s appearance as needed.
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] };
}
See Also