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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Is it possible to have all items collapsed?

Thread ID:

Created:

Updated:

Platform:

Replies:

150384 Jan 4,2020 09:35 PM UTC Jan 6,2020 09:34 AM UTC Xamarin.Forms 1
loading
Tags: SfAccordion
Santiago
Asked On January 4, 2020 09:35 PM UTC

I have this SfAccordion, but the first item is always open. Can I have all of them collapsed on init?

<accordion:SfAccordion
                x:Name="Accordion"
                BindableLayout.ItemsSource="{Binding Products}">
                <BindableLayout.ItemTemplate>
                    <DataTemplate>
                        <accordion:AccordionItem>
                            <accordion:AccordionItem.Header>
                                     <Label Text="Text Header" />
                            </accordion:AccordionItem.Header>
                            <accordion:AccordionItem.Content>
                                     <Label Text="Text Content" />
                            </accordion:AccordionItem.Content>
                        </accordion:AccordionItem>
                    </DataTemplate>
                </BindableLayout.ItemTemplate>
            </accordion:SfAccordion>

Lakshmi Natarajan [Syncfusion]
Replied On January 6, 2020 09:34 AM UTC

Hi Santiago, 
  
Thank you for using Syncfusion products. 
  
We have checked the reported query. We would like to let you know that Accordion allows you to load all the items in the collapsed state. You can achieve this requirement by setting the ExpandMode property as SingleOrNone. 
  
API details: 
  
Enum 
Description 
Single 
Expands one AccordionItem 
SingleOrNone 
Expands one AccordionItem or none 
Multiple 
Expands multiple AccordionItems 
MultipleOrNone 
Expands multiple AccordionItems or none 
  
Xaml: 
  
<accordion:SfAccordion x:Name="Accordion" 
                           ExpandMode="SingleOrNone" 
                           BindableLayout.ItemsSource="{Binding Products}"/> 
  
C#: 
  
  SfAccordion accordion = new SfAccordion(); 
  accordion.ExpandMode = ExpandMode.SingleOrNone; 
  
Note: The default value for the ExpandMode property is Single. 
  
Please let us know if you would require any further assistance. 
  
Regards, 
Lakshmi Natarajan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon