How to expand or collapse all the nodes in WPF PivotGrid control?
You can expand or collapse all nodes in both rows and columns of the WPF PivotGrid control by using ExpandAllGroup() or CollapseAllGroup() method.
Refer the below code for your reference.
XAML
<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"/>
C#
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(); }
Conclusion
I hope you enjoyed learning about how to expand or collapse all the nodes in WPF PivotGrid control.
You can refer to our WPF PivotGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF PivotGrid example to understand how to create and manipulate data.
For current customers, you can check out our Document Processing Libraries from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-trac, or feedback portal. We are always happy to assist you!