Skip to main content

PivotGridControl.CustomGroupInterval Event

Allows you to custom group values of a column and a row field.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v24.1.dll

NuGet Package: DevExpress.Wpf.PivotGrid


public event PivotCustomGroupIntervalEventHandler CustomGroupInterval

Event Data

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

Property Description
Field Gets the field being processed.
GroupValue Gets or sets a group value.
ThreadSafeField Gets the field being processed. Provides read-only access to field settings.
Value Gets the processed field value.



This member is not supported in Optimized, OLAP, and Server modes. Use ExpressionDataBinding for Optimized mode instead.

Values of column and row fields can be grouped into larger ranges. You can select one of the predefined group modes available via the PivotGridField.GroupInterval property. If none of these group modes match your requirements, you can implement custom grouping.

To custom group a field’s values, set the PivotGridField.GroupInterval property to Custom and handle the CustomGroupInterval event to implement custom grouping logic. The event fires for each value of a field. While handling the event, use the PivotCustomGroupIntervalEventArgs.GroupValue parameter to specify the group that will own the currently processed value. For values to be displayed in a single group, provide the same value for the GroupValue parameter.

Objects assigned to the GroupValue property must be of the same type for all values of a particular field.


This example shows how to implement custom group intervals in Pivot Grid to group axis values.

View Example

<Window xmlns:dxpg=""
        Title="MainWindow" Height="350" Width="525"
        <dxpg:PivotGridControl DataProcessingEngine="Optimized"
                               HorizontalAlignment="Left" Name="pivotGridControl1"
                <dxpg:PivotGridField Name="fieldProductGroup" Area="RowArea"
                                     Caption="Product Group">
                        <dxpg:ExpressionDataBinding Expression="Iif(Substring([fieldProductName], 0, 1) &lt; 'F', 'A-E', Substring([fieldProductName], 0, 1) &lt; 'T', 'F-S', 'T-Z')" />
                <dxpg:PivotGridField Name="fieldProductName" Area="RowArea"
                                     Caption="Product Name" >
                        <dxpg:DataSourceColumnBinding ColumnName="ProductName" />
                <dxpg:PivotGridField Name="fieldExtendedPrice"
                                     Area="DataArea" CellFormat="c0">
                        <dxpg:DataSourceColumnBinding ColumnName="Extended Price"/>
                <dxpg:PivotGridField Name="fieldCountry"
                                     Area="ColumnArea" >
                        <dxpg:DataSourceColumnBinding ColumnName="Country"/>

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomGroupInterval 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.

See Also