Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF DataGrid collapse all expander groups

$
0
0

Hello Guys!

I have a problem with collapsing the expanders from a grouped data in a WPF datagrid.

I followed the solution here, but it only collapses the expanders that are visible in the datagrid.

I have virtualization on the Datagrid and removing it is no solution.

I tried to do :

Collection<Expander> collection = VisualTreeHelper.GetVisualChildren<Expander>(this.mydataGrid);
foreach (Expander expander in collection)
{
   expander.IsExpanded = false;
}

Can you help?

Another approach to collapsing the expanders?

Thanks!



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>