Back to Devexpress

GridControl.GroupSummary Property

wpf-devexpress-dot-xpf-dot-grid-dot-gridcontrol-d17ec8d7.md

latest5.7 KB
Original Source

GridControl.GroupSummary Property

Gets a collection of group summary items.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public GridSummaryItemCollection GroupSummary { get; }
vb
Public ReadOnly Property GroupSummary As GridSummaryItemCollection

Property Value

TypeDescription
GridSummaryItemCollection

A collection of group summary items.

|

Remarks

When you group data against a column, the GridControl displays group summaries in group rows. To add a summary to the GridControl:

  1. Create a GridSummaryItem object and assign it to the GroupSummary collection.
  2. Specify the FieldName and SummaryType properties to apply the summary:
xaml
<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

xml
</dxg:GridControl.TotalSummary>
<dxg:GridControl.GroupSummary>
    <dxg:GridSummaryItem FieldName="Sensor1" SummaryType="Average"/>

wpf-data-grid-display-group-summaries/CS/DisplayGroupSummaries_CodeBehind/MainWindow.xaml#L18

xml
</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

xml
</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

xml
</dxg:GridControl.View>
<dxg:GridControl.GroupSummary>
    <dxg:GridSummaryItem FieldName="Age" SummaryType="Max"/>

wpf-data-grid-getting-started-net-framework/CS/WPFDataGridGettingStartedNETFramework/MainWindow.xaml#L33

xml
<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

csharp
void SortGroupsBySummary(GridColumn column) {
    GridGroupSummarySortInfo sortInfo = new GridGroupSummarySortInfo(grid.GroupSummary[0],
        column.FieldName, System.ComponentModel.ListSortDirection.Ascending);

See Also

TotalSummary

Group Summary

Edit Summaries

GridControl Class

GridControl Members

DevExpress.Xpf.Grid Namespace