PivotGridControl.Groups Property

Gets the collection of field groups.

Namespace: DevExpress.XtraPivotGrid

Assembly: DevExpress.XtraPivotGrid.v20.1.dll

Declaration

[Browsable(false)]
[XtraSerializableProperty(XtraSerializationVisibility.Collection, true, false, true, 100)]
[XtraSerializablePropertyId(3)]
public PivotGridGroupCollection Groups { get; }
<Browsable(False)>
<XtraSerializableProperty(XtraSerializationVisibility.Collection, True, False, True, 100)>
<XtraSerializablePropertyId(3)>
Public ReadOnly Property Groups As PivotGridGroupCollection

Property Value

Type Description
PivotGridGroupCollection

A PivotGridGroupCollection object which represents a collection of field groups.

Remarks

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.

Examples

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.

PivotGridControl_Groups

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