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
close icon

Collapse all items and error in docs

Is there any way to set the inital state of all the items to collapsed?

Also some of the examples on the web page https://help.syncfusion.com/wpf/sfaccordion/appearence-and-styling#applying-accent-colors  use Style examples like this;

<!--  AccordionButton Style -->
<Style TargetType="syncfusion:AccordionButton" x:Key="expanderButtonStyle">
    <!--  Customization codes -->
	    <VisualStateGroup x:Name="ExpansionStates">
		    <VisualState x:Name="Collapsed">

This won't compile, it gives an error "the attached property can only be applied to types that are derived from frameworkelement"
it needs to be set as below;

     <Style TargetType="syncfusion:AccordionButton" x:Key="expanderButtonStyle">
            <!--  Customization codes -->
            <Setter Property="Template">
                    <ControlTemplate TargetType="syncfusion:AccordionButton">
                        <Border x:Name="background" Background="{Binding Background}"  CornerRadius="1,1,1,1">

1 Reply

SP Subburaj Pandian Veluchamy Syncfusion Team July 5, 2019 01:40 PM UTC

Hi Tom, 
Thank you for contacting Syncfusion support. 
We have analyzed your reported query “Anyway to set the initial state of all the items to collapsed” in WPF SfAccordion. Currently, we did not have this support for SfAccordion. Please confirm and let us know about your requirement in detail, it will be helpful for us to consider the same while implementing. 
Regarding Documentation:  
We checked this code snippet and we can able to reproduce your reported error “The attached property can only be applied to types that are derived from Framework element". We have logged report to update the same, we will update as soon as possible. 
Subburaj Pandian V  

Live Chat Icon For mobile
Up arrow icon