Allows you to calculate summary values manually.
NuGet Package: DevExpress.Wpf.PivotGrid
public event PivotCustomSummaryEventHandler CustomSummary
Public Event CustomSummary As PivotCustomSummaryEventHandler
The CustomSummary event's data class is PivotCustomSummaryEventArgs. The following properties provide information specific to this event:
|ColumnField||Gets the column field that corresponds to the current cell.|
|ColumnFieldValue||Gets the value of the column field which corresponds to the current cell.|
|CustomValue||Gets or sets a custom summary value.|
|DataField||Gets the data field against which the summary is calculated.|
|FieldName||Gets the name of the data field against which the summary is calculated.|
|RowField||Gets the row field that corresponds to the current cell.|
|RowFieldValue||Gets the value of the row field which corresponds to the current cell.|
|SummaryValue||Gets an object which contains the values of the predefined summaries that are calculated for the current cell.|
|ThreadSafeColumnField||Gets the column field that corresponds to the current cell. Provides read-only access to field settings.|
|ThreadSafeDataField||Gets the data field against which the summary is calculated. Provides read-only access to field settings.|
|ThreadSafeRowField||Gets the row field that corresponds to the current cell.|
The event data class exposes the following methods:
|CreateDrillDownDataSource()||Returns a list of the records which are associated with the cell currently being processed.|
This member is not supported in Optimized, OLAP, and Server modes. Use ExpressionDataBinding for Optimized mode instead.
The CustomSummary event is raised when the PivotGridControl calculates its data for display. The CustomSummary event occurs for each cell that displays the value of the field whose PivotGridField.SummaryType property is set to FieldSummaryType.Custom.
In the event handler you can use the PivotCustomSummaryEventArgs.CreateDrillDownDataSource method to get a list of the records that is the data summarized in the current cell. You can process the data to calculate a custom summary and assign the result to the PivotCustomSummaryEventArgs.CustomValue property.
The PivotGridControl calculates all the predefined summaries (Average, Min, Max, Sum, etc) for each cell. You can access the calculated values using the PivotCustomSummaryEventArgs.SummaryValue property and use them in custom summary calculations.
The CustomSummary event occurs when the control layout is not ready yet. It means that other cells, columns and rows are not accessible.
To include other cells in a custom cell value calculation, handle the PivotGridControl.CustomCellValue event.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the CustomSummary event.
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.