Skip to main content
A newer version of this page is available. .

PivotGridGroup Class

Represents an individual group of fields.

Namespace: DevExpress.Xpf.PivotGrid

Assembly: DevExpress.Xpf.PivotGrid.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.PivotGrid, DevExpress.Wpf.PivotGrid

Declaration

public class PivotGridGroup :
    DXFrameworkContentElement,
    IEnumerable,
    IEnumerable<PivotGridField>

Remarks

The DXPivotGrid provides the capability to arrange fields into groups. Fields which are grouped cannot be separated by end-users by dragging one of them to a different area. Field groups are represented by the PivotGridGroup class and are stored within the PivotGridControl.Groups collection.

To learn more, see Field Groups.

Example

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

In this example, two fields (“Country” and “Customer”) are combined into a new group at design time, and another two fields (“Category” and “Product”) are combined into a new group at runtime, in this order. This ensures that the “Country” field is followed by “Customer”, and the the “Category” field is followed by “Product”. If you drag the “Region” field and drop it to another area, the “Customer” field accompanies it. This behavior is also true for the second group.

View Example: How to: Group Fields

using System.Windows;
using DevExpress.Xpf.PivotGrid;
using HowToBindToMDB.DataSet1TableAdapters;
using static HowToBindToMDB.DataSet1;

namespace HowToBindToMDB {
    public partial class MainWindow : Window {
        SalesPersonDataTable salesPersonDataTable = 
            new SalesPersonDataTable();
        SalesPersonTableAdapter salesPersonDataAdapter = new SalesPersonTableAdapter();
        public MainWindow() {
            InitializeComponent();
            pivotGridControl1.DataSource = salesPersonDataTable;
        }
        private void Window_Loaded(object sender, RoutedEventArgs e) {
            salesPersonDataAdapter.Fill(salesPersonDataTable);

            // Create a group at run-time
            PivotGridGroup group = pivotGridControl1.Groups.Add(fieldCategoryName, fieldProductName);
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the PivotGridGroup class.

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.

See Also