Skip to main content

DxSummaryItemBase<TModel>.Field Property

Specifies a data field whose values are used to calculate a summary.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor


public string Field { get; set; }

Property Value

Type Default Description
String String.Empty

The data field’s name.


To calculate a total or group summary in the Data Grid, add a DxDataGridSummaryItem object to the TotalSummary or GroupSummary collection. Use the item’s SummaryType property to specify an aggregate function. The following functions are available: Sum, Min, Max, Avg, and Count.

The Avg, Min, Max, and Sum functions require that you set the Field property to a data field whose values take part in calculations. The Min and Max functions require a numeric or date-time data field. The Avg and Sum functions work with numeric fields only.

If you select the Count function, you can leave the Field property set to an empty string and use the ShowInColumn property to specify which column displays the summary value.

<DxDataGrid Data="@Orders">
        <DxDataGridDateEditColumn Field="@nameof(Order.OrderDate)" Width="240px" />
        <DxDataGridComboBoxColumn Field="@nameof(Order.CountryId)"
                                  Caption="Ship Country"
                                  Width="250px" />
        <DxDataGridColumn Field="@nameof(Order.Product)" />
        <DxDataGridSpinEditColumn Field="@nameof(Order.UnitPrice)"
                                  Width="120px" />
        <DxDataGridSummaryItem Field=@nameof(Order.OrderDate)
                               DisplayFormat="First: {0:D}" />
        <DxDataGridSummaryItem Field=@nameof(Order.UnitPrice)
                               DisplayFormat="Sum: {0:c}" />
        <DxDataGridSummaryItem ShowInColumn=@nameof(Order.CountryId)
                               SummaryType=SummaryItemType.Count />

Data Grid Total Summary

Run Demo: Data Grid - Summary

See Also