We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Expanding or Collapsing all Groups

HI All,

Is it possible to Expand and or Collapse all the grouped items in a WPF Card View. 

 I have grouped them like so


and would like to Collapse them all initally




1 Reply

HN Harinath Navaneethakrishnan Syncfusion Team January 6, 2023 01:05 PM UTC

Hi Peter,

Currently, we have no support to collapse and expand the groups programmatically, however, you can achieve your requirement by accessing the expander control of the Cardview using a visual tree and changing its IsExpanded property.

Code Snippets:
private void FindExpanders(DependencyObject parent)
    int count = VisualTreeHelper.GetChildrenCount(parent);
    for (int i = 0; i < count; i++)
          var child = VisualTreeHelper.GetChild(parent, i);
          if (child is Expander expander)
                expander.IsExpanded = false;
We have created a simple sample based on your requirement. Please refer to the sample for your reference.


Harinath N

Attachment: CardView_4ac1639e.zip

Live Chat Icon For mobile
Up arrow icon