PivotGridWebGroup Class

Represents a group of fields.

Namespace: DevExpress.Web.ASPxPivotGrid

Assembly: DevExpress.Web.ASPxPivotGrid.v19.2.dll

Declaration

public class PivotGridWebGroup :
    PivotGridGroup,
    IDesignTimeCollectionItem
Public Class PivotGridWebGroup
    Inherits PivotGridGroup
    Implements IDesignTimeCollectionItem

Remarks

The ASPxPivotGrid enables you to arrange fields into groups. Fields that belong to a group are treated as a whole, and are always displayed within the same area and in the same order. If you drag a field from a group to another position, the entire group is moved.

PivotGridGroup

Field groups are represented by the PivotGridWebGroup class, and are stored within the ASPxPivotGrid's ASPxPivotGrid.Groups collection. Groups hold fields within their PivotGridWebGroup.Fields collection. To ungroup the fields, the group must be removed. Note that fields are not disposed of in this case. To unlink individual fields, use the group's Remove method.

Examples

This example shows how to arrange fields into groups.

In the example, two fields, 'Quantity' and 'UnitPrice', are combined into a new group. This ensures that the 'UnitPrice' field will be followed by the 'Quantity'. If the 'UnitPrice' field is dragged to another area, the 'Quantity' field will be dragged as well.

The image below shows you how to create field groups at design time in the ASPxPivotGrid Designer.

GreateFieldGroup

using DevExpress.Web.ASPxPivotGrid;

protected void Page_Load(object sender, EventArgs e) {
    ASPxPivotGrid1.Groups.Add(CreateFieldGroup(new string[] { "UnitPrice", "Quantity" }, "Price"));
}

PivotGridWebGroup CreateFieldGroup(string[] fields, string groupCaption) {
    PivotGridWebGroup group = new PivotGridWebGroup();
    for (int i = 0; i < fields.Length; i++)
        group.Add(ASPxPivotGrid1.Fields[fields[i]]);
    // Specifies the group's text when it's displayed within the customization window. 
    group.Caption = groupCaption;
    return group;
}

Inheritance

Implements

See Also