Skip to main content

DxGrid.DataColumnCellDisplayTemplate Property

Specifies a common template used to display all data column cells in the Grid.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor


public RenderFragment<GridDataColumnCellDisplayTemplateContext> DataColumnCellDisplayTemplate { get; set; }

Property Value

Type Description

The template for all data column cells.


The DataColumnCellDisplayTemplate allows you to specify custom content and change the appearance of cells in all Grid data columns. To define a template for individual Grid data columns, use the DxGridDataColumn.CellDisplayTemplate.

The DataColumnCellDisplayTemplate accepts a GridDataColumnCellDisplayTemplateContext object as the context parameter. You can use the parameter’s members to get information about a column cell (DataColumn, Value, DisplayText, HighlightedDisplayText, VisibleIndex). You can also access the Grid object and use its members to obtain additional information about the Grid.

The following example customizes appearance of column cells to distinguish between odd and even rows:

@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<NorthwindContext> NorthwindContextFactory
@implements IDisposable

    .my-style {
        color: blue;
        font-weight: bold;
    .my-date-style {
        color: mediumblue;
        font-weight: bold;

<DxGrid Data="@Data">
        <DxGridDataColumn FieldName="FirstName" />
        <DxGridDataColumn FieldName="LastName" />
        <DxGridDataColumn FieldName="Title" />
        <DxGridDataColumn FieldName="BirthDate" />
        <DxGridDataColumn FieldName="HireDate" />
            if (context.VisibleIndex % 2 == 1) {
                if (context.DataColumn.FieldName.Contains("Date")) {
                    <span class="my-date-style">@context.DisplayText</span>
                } else {
                    <span class="my-style">@context.DisplayText</span>
            } else {

@code {
    IEnumerable<Employee> Data { get; set; }
    NorthwindContext Northwind { get; set; }
    Employee CurrentEmployee { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        Data = Northwind.Employees

    public void Dispose() {

Blazor Grid Column Cell Display Template

For more information about templates in the Grid component, refer to the following topic: Templates in Blazor Grid.

See Also