PivotGridControl.Groups Property

Gets the collection of field groups.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v21.1.dll


[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true, 100)]
public PivotGridGroupCollection Groups { get; }

Property Value

Type Description

A PivotGridGroupCollection object which represents a collection of field groups.


Individual fields can be combined into a group which is represented by a PivotGridGroup object. If specific fields belong to a group they are treated as a whole and are always displayed within the same area. An end-user cannot separate these fields by dragging one of them to a different area or hiding it to the Customization Form.


The following example demonstrates how to combine fields into a group.

In the example three fields (‘Country’, ‘Region’ and ‘City’) are combined into a new group in that order. This ensures that the ‘Country’ field will be followed by ‘Region’ which is in turn followed by ‘City’. If the ‘Region’ field is being dragged to another area the other fields will be dragged as well. The following image shows the ‘Region’ field being dragged to the Filter Header Area.


using DevExpress.XtraPivotGrid;

PivotGridField fieldCountry = pivotGridControl1.Fields["Country"];
PivotGridField fieldRegion = pivotGridControl1.Fields["Region"];
PivotGridField fieldCity = pivotGridControl1.Fields["City"];
// Add a new group which combines the fields.
pivotGridControl1.Groups.Add(new PivotGridField[] {fieldCountry, fieldRegion, fieldCity});
See Also