wpf-devexpress-dot-xpf-dot-grid-dot-gridcontrol-d17ec8d7.md
Gets a collection of group summary items.
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public GridSummaryItemCollection GroupSummary { get; }
Public ReadOnly Property GroupSummary As GridSummaryItemCollection
| Type | Description |
|---|---|
| GridSummaryItemCollection |
A collection of group summary items.
|
When you group data against a column, the GridControl displays group summaries in group rows. To add a summary to the GridControl:
<dxg:GridControl AutoGenerateColumns="AddNew" ItemsSource="{Binding Customers}">
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Visits" SummaryType="Max"/>
</dxg:GridControl.GroupSummary>
</dxg:GridControl>
The GridSummaryItem objects are summary items. The GroupSummary collection’s methods allow you to add, remove, and access summary items.
You can access a collection of total summary items with the GridControl.TotalSummary property.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GroupSummary property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
wpf-data-grid-process-frequent-data-updates/CS/ChunkAndOptSummariesExample/MainWindow.xaml#L20
</dxg:GridControl.TotalSummary>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Sensor1" SummaryType="Average"/>
wpf-data-grid-display-group-summaries/CS/DisplayGroupSummaries_CodeBehind/MainWindow.xaml#L18
</dxg:GridControl.Columns>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Age" SummaryType="Min"/>
wpf-data-grid-summarize-empty-cells/CS/CustomSummary_EmptyCells_CodeBehind/MainWindow.xaml#L26
</dxg:GridControl.TotalSummary>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem DisplayFormat="Group empty cells count: {0}"
how-to-sort-group-rows-by-summary-values-e1540/CS/DXSample_SortGroupsBySummary/Window1.xaml#L13
</dxg:GridControl.View>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Age" SummaryType="Max"/>
<dxg:GridControl.GroupSummary>
<dxg:GridSummaryItem FieldName="Freight" SummaryType="Sum" DisplayFormat="Sum of Freight is {0:c}"/>
how-to-sort-group-rows-by-summary-values-e1540/CS/DXSample_SortGroupsBySummary/Window1.xaml.cs#L14
void SortGroupsBySummary(GridColumn column) {
GridGroupSummarySortInfo sortInfo = new GridGroupSummarySortInfo(grid.GroupSummary[0],
column.FieldName, System.ComponentModel.ListSortDirection.Ascending);
See Also