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

Does not work Sfexpander expand action with SfListview

Hi i am using SfExpander with SfListview like attached files. If i use only expander, the expand action is working. But if i use together sflistview, the expand action is not working. I cannot see the contents.


Attachment: sflistview_7b11ea1.rar

8 Replies

SR Sangeetha Raju Syncfusion Team September 13, 2019 11:28 AM UTC

Hi Mahmut, 
 
Thank you for contacting Syncfusion support. 
 
We would like to inform you that reported issue occurs due to the height measure doesn’t happen at runtime. So, you have to set the AutoFitMode property as ‘DynamicHeight to the SfListView as like below code snippet. The reported issue will be resolved.  
 
<sflistview:SfListView ItemsSource="{Binding Info}" 
                                   AutoFitMode="DynamicHeight"> 
 
Also, refer the documentation for further information. 
 
 
Please let us know if you require any further assistance. 
 
Regards, 
Sangeetha Raju. 



MN Mahmut Nedim September 16, 2019 12:49 PM UTC

Thank you for your answer, i have solved. but i have another problem. I have send code blog and two picture. when the all rows Isexpand are close the lists Heightrequest is fine like "pic1.png", but if i expand any row the contents layout heightrequest is so long like "pic2.png". how can i solved?


Attachment: expanderAndListview_a30f8179.rar


SR Sangeetha Raju Syncfusion Team September 17, 2019 11:38 AM UTC

Hi Mahmut, 
 
We would like to inform you that the reported issue gets replicated at our end. We have to find the root cause of this issue hence we will update you with further details on September 18, 2019. 
 
We appreciate your patience until then. 
 
Regards, 
Sangeetha Raju. 



SR Sangeetha Raju Syncfusion Team September 18, 2019 01:53 PM UTC

Hi Mahmut, 
 
We would like to let you know that you can overcome the reported issue by extending the inner ListView and set the TotalExtent for the Height of the ListView as like below code snippet. 
 
public class ExtendedListView : SfListView 
{ 
   VisualContainer container; 
   public ExtendedListView() 
   { 
      container = this.GetVisualContainer(); 
      container.PropertyChanged += Container_PropertyChanged; 
   } 
 
   private void Container_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 
   { 
      if (e.PropertyName == nameof(Height)) 
      { 
         var extent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(container => container.Name == "TotalExtent").GetValue(container); 
         this.HeightRequest = extent; 
      } 
   } 
} 
 
We have attached the tested sample for your reference. Please find the sample from the below link. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
Sangeetha Raju. 



MN Mahmut Nedim September 19, 2019 08:30 AM UTC

thank u very much. I have solved


SR Sangeetha Raju Syncfusion Team September 20, 2019 06:10 AM UTC

Hi Mahmut,  
  
Thank you for the update. Please let us know if you require any further assistance.  
  
Regards,  
Sangeetha Raju.  



AN Andrea September 2, 2020 11:03 PM UTC

Hi, I tried this solution to make the list with the right height, bust still not work. Should I just need to 
public class ExtendedListView : SfListView    { [...ecc...] }
at the end of the file where i place that list?


LN Lakshmi Natarajan Syncfusion Team September 3, 2020 06:29 AM UTC

Hi Andrea, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Expander with nested ListView” from our end. We would like to inform you that you need to update the inner ListView’s HeightRequest to update the ListView based on items height 
 
Please refer to the following documentation regarding working with nested listview from the below link, 
 
Also, we have attached the tested sample in the following link, 
 
Please let us know if you need further assistance. 
 
Regards, 
Lakshmi Natarajan 


Loader.
Live Chat Icon For mobile
Up arrow icon