Skip to main content

DxGridDataColumn.DisplayFormat Property

Specifies the format of column values and summary values calculated for this column.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public string DisplayFormat { get; set; }

Property Value

Type Default Description
String null

The format string.


Use the DisplayFormat property to format values displayed in column cells and summaries. For information about supported format strings, refer to the following topics:


A summary’s ValueDisplayFormat property takes priority over the column’s DisplayFormat.

The code snippet below applies the following formats:

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

<DxGrid Data="GridDataSource">
        <DxGridDataColumn FieldName="OrderDate" DisplayFormat="d" />
        <DxGridDataColumn FieldName="CustomerName" />
        <DxGridDataColumn FieldName="Country" />
        <DxGridDataColumn FieldName="Freight" DisplayFormat="n2" />
        <DxGridDataColumn FieldName="ExtendedPrice" DisplayFormat="c" />
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Avg" FieldName="ExtendedPrice" />

@code {
    object GridDataSource { get; set; }
    NorthwindContext Northwind { get; set; }

    protected override void OnInitialized() {
        Northwind = NorthwindContextFactory.CreateDbContext();
        GridDataSource = new GridDevExtremeDataSource<Invoice>(Northwind.Invoices);

    public void Dispose() {

Data Column Display Format

The DisplayFormat property also accepts format strings with the {0} placeholder that replaces a column value. The format string syntax is below:

<custom text>{0:<format specifier>}<custom text>

  • custom text - any plain text displayed before and after the column value.
  • ‘{0}’ - the placeholder for the column value.
  • format specifier - specifies the value format.

The following code shows possible format strings:

<DxGrid Data="GridDataSource">
        @* ... *@
        <DxGridDataColumn FieldName="ExtendedPrice" DisplayFormat="c" />
        @* or *@
        <DxGridDataColumn FieldName="ExtendedPrice" DisplayFormat="${0}" />
        @* or *@
        <DxGridDataColumn FieldName="ExtendedPrice" DisplayFormat="my custom text {0:c}" />


See Also