Skip to main content

ASPxPivotGrid.CustomGroupInterval Event

Enables grouping axis values, using your own criteria.

Namespace: DevExpress.Web.ASPxPivotGrid

Assembly: DevExpress.Web.ASPxPivotGrid.v24.1.dll

NuGet Package: DevExpress.Web


public event PivotGridCustomGroupIntervalEventHandler 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. Inherited from PivotFieldEventArgsBase<T>.
GroupValue Gets or sets a group value.
Value Gets the processed field value.



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

The CustomGroupInterval event is raised for each row or column field whose PivotGridFieldBase.GroupInterval property is set to ‘Custom’.

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


The following example implements custom group intervals in the Pivot Grid to group the Product Name field values into three ranges: A-E, F-S, and T-Z (according to the initial characters of the product names). The following expression is used:

Iif(Substring([Product Name], 0, 1) < 'F', 'A-E', Substring([Product Name], 0, 1) < 'T', 'F-S', 'T-Z')

The image below shows the result:


View Example

<dx:ASPxPivotGrid ID="ASPxPivotGrid1" runat="server" DataSourceID="ProductReportsDataSource"
    CssClass=""  OnDataBound="ASPxPivotGrid1_DataBound"
        <dx:PivotGridField Area="RowArea" AreaIndex="0" Caption="Product Group" 
            ID="fieldProductName0" Visible="True" GroupInterval="Custom">
                <dx:ExpressionDataBinding Expression="Iif(Substring([fieldProductName1], 0, 1) &lt; 'F', 'A-E', Substring([fieldProductName1], 0, 1) &lt; 'T', 'F-S', 'T-Z')" />
        <dx:PivotGridField Area="RowArea" AreaIndex="1" Caption="Product"
                <dx:DataSourceColumnBinding ColumnName="ProductName" />
        <dx:PivotGridField Area="DataArea" AreaIndex="0" Caption="Sales"
            ID="fieldProductSales" >
                <dx:DataSourceColumnBinding ColumnName="ProductSales" />
        <dx:PivotGridField Area="ColumnArea" AreaIndex="0" Caption="Year - Quarter" 
            ID="fieldShippedDate0" Visible="False">
                <dx:DataSourceColumnBinding ColumnName="ShippedDate" />
        <dx:PivotGridField Area="ColumnArea" AreaIndex="1" Caption="Shipped Date"
                <dx:DataSourceColumnBinding ColumnName="ShippedDate" GroupInterval="DateYear" />
    <OptionsView ShowFilterHeaders="False" HorizontalScrollBarMode="Auto" />
    <OptionsFilter NativeCheckBoxes="False" />
    <OptionsData DataProcessingEngine="Optimized" />
See Also