How to expand and collapse entire group in PivotGrid?

Expanding entire group in PivotGrid

After defining PivotGrid control, invoke the method ExpandAllGroup() to expand entire group in the PivotGrid control.

Please refer the below code sample.

  • c#
  • public MainWindow()
            {
                InitializeComponent();
                //To expand entire group in PivotGrid
                pivotGrid.ExpandAllGroup();
            }

    Collapsing entire group in PivotGrid

    After defining PivotGrid control, invoke the method CollapseAllGroup() to collapse entire group in the PivotGrid control.

    Please refer the below code sample.

  • c#
  • public MainWindow()
            {
                InitializeComponent();   
                //To collapse entire group in PivotGrid
                pivotGrid.CollapseAllGroup();
            }