Back to Devexpress

PivotGridControl.CustomSummary Event

wpf-devexpress-dot-xpf-dot-pivotgrid-dot-pivotgridcontrol-b72a3e93.md

latest5.6 KB
Original Source

PivotGridControl.CustomSummary Event

Allows you to calculate summary values manually.

Namespace : DevExpress.Xpf.PivotGrid

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

NuGet Package : DevExpress.Wpf.PivotGrid

Declaration

csharp
public event PivotCustomSummaryEventHandler CustomSummary
vb
Public Event CustomSummary As PivotCustomSummaryEventHandler

Event Data

The CustomSummary event's data class is PivotCustomSummaryEventArgs. The following properties provide information specific to this event:

PropertyDescription
ColumnFieldGets the column field that corresponds to the current cell.
ColumnFieldValueGets the value of the column field which corresponds to the current cell.
CustomValueGets or sets a custom summary value.
DataFieldGets the data field against which the summary is calculated.
FieldNameGets the name of the data field against which the summary is calculated.
RowFieldGets the row field that corresponds to the current cell.
RowFieldValueGets the value of the row field which corresponds to the current cell.
SummaryValueGets an object which contains the values of the predefined summaries that are calculated for the current cell.
ThreadSafeColumnFieldGets the column field that corresponds to the current cell. Provides read-only access to field settings.
ThreadSafeDataFieldGets the data field against which the summary is calculated. Provides read-only access to field settings.
ThreadSafeRowFieldGets the row field that corresponds to the current cell.

The event data class exposes the following methods:

MethodDescription
CreateDrillDownDataSource()Returns a list of the records which are associated with the cell currently being processed.

Remarks

Important

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.

Tip

To include other cells in a custom cell value calculation, handle the PivotGridControl.CustomCellValue event.

See Also

SummaryType

How to provide custom summary values for Total, Grand Total and ordinary cells

PivotGridControl Class

PivotGridControl Members

DevExpress.Xpf.PivotGrid Namespace