Skip to main content
A newer version of this page is available. .

PivotCustomGroupIntervalEventArgs Class

Provides data for the PivotGridControl.CustomGroupInterval event.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v17.2.dll

Declaration

public class PivotCustomGroupIntervalEventArgs :
    PivotCustomGroupIntervalEventArgsBase<PivotGridField>

Example

This example shows how to provide a custom criteria used to group axis values. The Pivot Grid Control contains two row fields bound to the same ProductName data source field, named Product Group and Product respectively. The custom grouping is applied to the first field and combines the first field’s values by the starting characters of values into three large ranges: A-E, F-S, and T-Z.

The Product Group field’s PivotGridFieldBase.GroupInterval property is set to Custom at design-time. The grouping logic is implemented by handling the PivotGridControl.CustomGroupInterval event.

PivotGridControl_CustomGroupInterval_ex

protected void PivotGridControl_CustomGroupInterval(object sender, 
PivotCustomGroupIntervalEventArgs e) {
    if (e.Field.Caption != "Product Group") return;

    if (Convert.ToChar(e.Value.ToString()[0]) < 'F') {
        e.GroupValue = "A-E";
        return;
    }

    if (Convert.ToChar(e.Value.ToString()[0]) > 'E' && 
    Convert.ToChar(e.Value.ToString()[0]) < 'T') {
        e.GroupValue = "F-S";
        return;
    }

    if (Convert.ToChar(e.Value.ToString()[0]) > 'S')
        e.GroupValue = "T-Z";
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the PivotCustomGroupIntervalEventArgs class.

Note

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