DxDataGrid<T>.Columns Property

Specifies the data grid’s column collection.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

Declaration

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

Property Value

Type Description
RenderFragment

A collection of columns (UI fragments) that is rendered in the data grid’s markup.

Remarks

If you do not use templates in the data grid component, you can specify columns directly between the <DxDataGrid> and </DxDataGrid> tags.

<DxDataGrid DataAsync="@ForecastService.GetForecastAsync">
    <DxDataGridCommandColumn></DxDataGridCommandColumn>
    <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.TemperatureC)"></DxDataGridSpinEditColumn> 
    ...
</DxDataGrid>

When you define templates (for instance, EditFormTemplate or DetailRowTemplate), you should use the Columns property to add grid columns.

<DxDataGrid Data="@ProductCategories.DataSource" >
    <Columns>
        <DxDataGridCommandColumn></DxDataGridCommandColumn>
        <DxDataGridSpinEditColumn Field="@nameof(WeatherForecast.TemperatureC)"></DxDataGridSpinEditColumn> 
        ...
    </Columns>
    <DetailRowTemplate>
        ...
    </DetailRowTemplate>
</DxDataGrid>
See Also