DataControlBase.TotalSummaryGeneratorTemplate Property
Gets or sets a template that describes total summaries. This is a dependency property.
Namespace: DevExpress.Xpf.Grid
Assembly: DevExpress.Xpf.Grid.v25.1.Core.dll
NuGet Package: DevExpress.Wpf.Grid.Core
Declaration
Property Value
Type | Description |
---|---|
DataTemplate | The summary item template. |
Remarks
You can define total summaries in a ViewModel and display them in the GridControl. To do this, follow the steps below:
- Create a collection of total 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 total summary collection to the TotalSummarySource property and the summary template to the TotalSummaryGeneratorTemplate property:
<dxg:GridControl ... TotalSummarySource="{Binding TotalSummary}" TotalSummaryGeneratorTemplate="{StaticResource SummaryTemplate}"> <dxg:GridControl.View> <dxg:TableView TotalSummaryPosition="Bottom"/> </dxg:GridControl.View> </dxg:GridControl>
Refer to the following help topic for more information: How to: Bind the Grid to Total and Group Summaries.
See Also