PivotGridWebGroup.Fields Property
In This Article
Provides access to the group’s field collection.
Namespace: DevExpress.Web.ASPxPivotGrid
Assembly: DevExpress.Web.ASPxPivotGrid.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
#Property Value
Type | Description |
---|---|
IList | An object which implements the IList interface. |
#Example
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.
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;
}
See Also