Skip to main content

IGridDataColumn Interface

An interface that defines a Grid data column‘s API members (properties and methods).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor


public interface IGridDataColumn :


We recommend that you use the IGridDataColumn interface when you access a Grid data column’s API members in any of the following cases:

  • You use the @ref attribute to reference a Grid data column. For example, you set or change values of the Grid column’s parameters outside the markup.
  • You access a DataColumn object from templates or event handlers.
  • You access elements of the Grid column collection. For example, the collection that is returned by the GetDataColumns() method.

In all other cases, bind your data to column parameters.

The following code snippet defines the DataColumnCellDisplayTemplate template to customize the appearance of column cells to distinguish between odd and even rows. The template context‘s DataColumn property (which returns an IGridDataColumn object) provides access to a grid data column to which the processed cell belongs.

@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

See Also