This session describes how to expand or collapse WPF PivotGrid.
You can expand or collapse all nodes in both rows and columns of the PivotGrid control by using ExpandAllGroup or CollapseAllGroup method.
Refer the below code for your reference.
<syncfusion:PivotGridControl Name="pivotGrid"
HorizontalAlignment="Center"
Margin="0,0,0,40"
VerticalAlignment="Center"
skin:SfSkinManager.VisualStyle="Office2016Colorful" />
<Button Content="Expand" Name="Expand"
HorizontalAlignment="Center"
Margin="201,379,0,0" Click="Expand_Click"
VerticalAlignment="Center" Width="75"
skin:SfSkinManager.VisualStyle="Office2016Colorful"/>
<Button Content="Collapse" Name="Collapse"
HorizontalAlignment="Center"
Margin="10,379,110,0"
Click="Collapse_Click"
VerticalAlignment="Center"
Width="75"
skin:SfSkinManager.VisualStyle="Office2016Colorful"/>private void Expand_Click(object sender, RoutedEventArgs e)
{
//Expand all nodes in rows and columns
pivotGrid.ExpandAllGroup();
}
private void Collapse_Click(object sender, RoutedEventArgs e)
{
//Collapse all nodes in rows and columns
pivotGrid.CollapseAllGroup();
}