SummaryItemType Enum

Lists values that specify summary functions.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v20.2.dll

Declaration

public enum SummaryItemType

Members

Name Description
None

Does not calculate the summary.

Sum

Calculates the sum across the entire grid or individual groups.

Min

Calculates the minimum across the entire grid or individual groups.

Max

Calculates the maximum value across the entire grid or individual groups.

Avg

Calculates the average of all the values within the entire grid or individual groups.

Count

Counts the number of rows within the entire grid or individual groups.

Related API Members

The following properties accept/return SummaryItemType values:

Remarks

To calculate a total or group summary in the Data Grid, add a DxDataGridSummaryItem object to the TotalSummary or GroupSummary collection. Set the item's SummaryType property to a SummaryItemType enumeration value.

The Avg, Min, Max, and Sum functions require that you set the Field property to a data field whose values are used 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.

The Count function does not process any field values. If you select this function, use either the Field or ShowInColumn property to specify which column displays the number of rows.

<DxDataGrid Data="@Orders">
    <Columns>
        <DxDataGridDateEditColumn Field="@nameof(Order.OrderDate)" Width="240px" />
        <DxDataGridComboBoxColumn Field="@nameof(Order.CountryId)"
                                  Caption="Ship Country"
                                  Data="@Countries"
                                  ValueFieldName="@nameof(Country.Id)"
                                  TextFieldName="@nameof(Country.CountryName)"
                                  FilteringMode="DataGridFilteringMode.Contains"
                                  Width="250px" />
        <DxDataGridColumn Field="@nameof(Order.Product)" />
        <DxDataGridSpinEditColumn Field="@nameof(Order.UnitPrice)"
                                  DisplayFormat="c"
                                  Width="120px" />
    </Columns>
    <TotalSummary>
        <DxDataGridSummaryItem Field=@nameof(Order.OrderDate)
                               SummaryType=SummaryItemType.Min
                               DisplayFormat="First: {0:M}" />
        <DxDataGridSummaryItem Field=@nameof(Order.OrderDate)
                               SummaryType=SummaryItemType.Max
                               DisplayFormat="Last: {0:M}" />
        <DxDataGridSummaryItem Field=@nameof(Order.UnitPrice)
                               SummaryType=SummaryItemType.Sum
                               DisplayFormat="Sum: {0:c}" />
        <DxDataGridSummaryItem Field=@nameof(Order.UnitPrice)
                               SummaryType=SummaryItemType.Avg
                               DisplayFormat="Avg: {0:c}" />
        <DxDataGridSummaryItem ShowInColumn=@nameof(Order.CountryId)
                               SummaryType=SummaryItemType.Count />
    </TotalSummary>
</DxDataGrid>

Data Grid Summary Functions

For more information, refer to the following help topic: Summary.

Run Demo: Data Grid - Summary

See Also