PivotCustomGroupIntervalEventArgs.GroupValue Property
Gets or sets a group value.
Namespace: DevExpress.Web.ASPxPivotGrid
Assembly: DevExpress.Web.ASPxPivotGrid.v19.2.dll
Declaration
Property Value
Type | Description |
---|---|
Object | An object that represents the group value. |
Remarks
The ASPxPivotGrid.CustomGroupInterval event enables you to group axis values using your own criteria. Use the GroupValue property to specify group values.
Example
This example shows how to provide a custom criteria used to group axis values. The Custom Group Intervals feature is used to group product names and make the report more readable. The Product axis will show three intervals (“A-J”, “K-S” and “T-Z”).
The ‘Products’ field’s PivotGridFieldBase.GroupInterval property is set to Custom at design-time. The grouping logic is implemented within the ASPxPivotGrid.CustomGroupInterval event handler.
The image below shows the result:
protected void ASPxPivotGrid1_CustomGroupInterval(object sender,
DevExpress.Web.ASPxPivotGrid.PivotCustomGroupIntervalEventArgs e)
{
if (e.Field.Caption != "Products") return;
if (Convert.ToChar(e.Value.ToString()[0]) < 'K')
{
e.GroupValue = "A-J";
return;
}
if (Convert.ToChar(e.Value.ToString()[0]) > 'J' && Convert.ToChar(e.Value.ToString()[0]) < 'T')
{
e.GroupValue = "K-S";
return;
}
if (Convert.ToChar(e.Value.ToString()[0]) > 'S')
e.GroupValue = "T-Z";
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GroupValue property.
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.