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

How to bind IsExpanded property in Xamarin.Forms Accordion (SfAccordion) ?

Is IsExpanded not bindable??

1 Reply

DB Dinesh Babu Yadav Syncfusion Team April 17, 2019 12:56 PM UTC

Hi Eugen, 
 
Thank you for contacting Syncfusion support. 
 
We would like to let you know that the IsExpanded property of an AccordionItem is a bindable property. But currently, we didn’t provided the binding support to AccordionItem. So, you can achieve the reported requirement by defining the binding context for each accordion item as like below code example. 
 
Code Example[XAML]: 
<syncfusion:SfAccordion ExpandMode="MultipleOrNone" x:Name="accordion"> 
  <syncfusion:SfAccordion.Items>  
    <syncfusion:AccordionItem IsExpanded="{Binding InvoiceHeader}"  
            BindingContext="{Binding Path=BindingContext, Source={x:Reference accordion}}"> 
 
    </syncfusion:AccordionItem> 
  </syncfusion:SfAccordion.Items> 
</syncfusion:SfAccordion> 
 
For your reference, we have prepared the sample and you can download it from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 


Loader.
Live Chat Icon For mobile
Up arrow icon