Skip to main content
A newer version of this page is available. .

DxGridSummaryItem.FieldName Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v21.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public string FieldName { get; set; }

Property Value

Type Description
String

The data field’s name.

Remarks

The DxGrid supports the total and group summaries. Each summary can contain predefined and custom summary items.

Use the summary item’s SummaryType property to specify an aggregate function to calculate the total and group summary values. The following functions are available: Sum, Min, Max, Avg, and Count.

The Avg, Min, Max, and Sum functions require that you set the FieldName 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 FieldName property set to an empty string and use the FooterColumnName property to specify which column displays the summary value.

Run Demo: Grid - Total Summary Run Demo: Grid - Group Summary

<DxGrid Data="GridDataSource"
        UnboundColumnData="Grid_CustomUnboundColumnData"
        ShowGroupPanel="true">
    <Columns>
        <DxGridDataColumn FieldName="Order.ShipName" Caption="Contact Name" />
        <DxGridDataColumn FieldName="Order.ShipCountry" Caption="Country" />
        <DxGridDataColumn FieldName="Order.ShipCity" Caption="City" />
        <DxGridDataColumn FieldName="ProductId" DisplayFormat="d" />
        <DxGridDataColumn FieldName="UnitPrice" />
        <DxGridDataColumn FieldName="Quantity" />
        <DxGridDataColumn FieldName="Discount" DisplayFormat="p0" />
        <DxGridDataColumn FieldName="TotalPrice"
                      DisplayFormat="c"
                      UnboundType="GridUnboundColumnType.Decimal" />
    </Columns>
    <GroupSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Max"
                           ValueDisplayFormat="c"
                           FieldName="UnitPrice" />
    </GroupSummary>
    <TotalSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Sum" FieldName="TotalPrice" />
    </TotalSummary>
</DxGrid>

DevExpress Blazor Grid - Summaries

Implements

See Also