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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Collapse/Expand Icon in CustomGroup Headers

Thread ID:





131176 Jun 26,2017 06:16 PM UTC Jun 28,2017 04:47 AM UTC Xamarin.Forms 3
Tags: SfListView
Asked On June 26, 2017 11:38 PM UTC

Hello, I have custom group headers in my expanding/collapsing listview.  I would like to show icons for collapsing and expanding in the group header.  I have reviewed the LoadGroupIconSample, but do not see where the GroupCollapse and GroupExpand images are ever referenced, besides in the BoolToImageConverter.  Do you have any other examples of adding icons to the custom group headers?This is in C#.

Dinesh Babu Yadav [Syncfusion]
Replied On June 27, 2017 09:15 AM UTC

Hi Tommy, 
Thank you for using Syncfusion Products. 
The reported requirement “Loading Expand and Collapse icons in Group Header” can be achieved by customizing the GroupHeaderTemplate such as load an image in the group header template as like below code snippet and by using IsExpand property, which determines whether the group is expanded or collapsed and by using custom converter, you can change the image’s source at runtime as required for example, if IsExpand is true, return Expand icon else return Collapse icon. 
Code Example[C#]: 
var image = new Image(); 
Binding binding = new Binding("IsExpand"); 
binding.Converter = new BoolToImageConverter(); 
image.SetBinding(Image.SourceProperty, binding); 
image.HeightRequest = 30; 
image.WidthRequest = 30; 
image.VerticalOptions = LayoutOptions.Center; 
image.HorizontalOptions = LayoutOptions.Center; 
grid.Children.Add(image, 0, 0); 
grid.Children.Add(label, 1, 0); 
For your reference, we have prepared the sample in code behind as per your requirement and you can download it from the below link. 

Please let us know if you require further assistance. 
Dinesh Babu Yadav 

Replied On June 27, 2017 12:54 PM UTC

Thank you Dinesh.  This example is perfect.

Dinesh Babu Yadav [Syncfusion]
Replied On June 28, 2017 04:47 AM UTC

Hi Tommy, 
Thanks for the update. 
Dinesh Babu Yadav 


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