GridControl.GroupSummarySource Property
Gets or sets the source from which the grid generates group summary items. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v24.2.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
IEnumerable | The source from which the grid generates group summary items. |
Remarks
You can define group summaries in a ViewModel and display them in the GridControl. To do this, follow the steps below:
- Create a collection of group summaries in a ViewModel.
Specify a data template that generates summaries:
<Window.Resources> <DataTemplate x:Key="SummaryTemplate"> <ContentControl> <dxg:GridSummaryItem FieldName="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).FieldName, RelativeSource={RelativeSource Self}}" SummaryType="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).Type, RelativeSource={RelativeSource Self}, Converter={StaticResource SummaryTypeConverter}}"/> </ContentControl> </DataTemplate> </Window.Resources>
Assign the group summary collection to the GroupSummarySource property and the summary template to the GroupSummaryGeneratorTemplate property:
<dxg:GridControl ... GroupSummarySource="{Binding GroupSummary}" GroupSummaryGeneratorTemplate="{StaticResource SummaryTemplate}"/>
Refer to the following help topic for more information: How to: Bind the Grid to Total and Group Summaries.
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupSummarySource 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.