Skip to main content

Group Summary

A group summary represents a value of an aggregate function calculated over all data rows within a group. Group summaries are displayed within group rows and are stored within a grid's GridControl.GroupSummary collection.

Total_Group_Summaries

#Displaying Group Summaries

To create a group summary item, do the following.


<dxg:GridControl.GroupSummary>
    <dxg:GridSummaryItem DisplayFormat="Max: {0:c2}" FieldName="UnitPrice"
        ShowInColumn="" SummaryType="Max" />
</dxg:GridControl.GroupSummary>

To display group summaries in code, create a new instance of the GridSummaryItem class, specify its properties and add it to the GridControl.GroupSummary collection.


DevExpress.Xpf.Grid.GridSummaryItem groupSummaryItem = new DevExpress.Xpf.Grid.GridSummaryItem();
groupSummaryItem.FieldName = "UnitPrice";
groupSummaryItem.DisplayFormat = "Max: {0:c2}";
groupSummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max;
grid.GroupSummary.Add(groupSummaryItem);

#Obtaining Summary Values

To obtain a group summary value displayed within a specified group row, use the GridControl.GetGroupSummaryValue method.

See Also