SfListView issues after upgrading to version 16.2.0.50

Hello,
I use the SfListView control in my project and everything worked as expected until version 16.2.0.37.

Now, with version .0.50, a lot of extra white space is added at the bottom of the list especially with sources that contain a few items and I don't know how to remove it. Any suggestions, please, or any help about breaking changes in the latest version?

Thanks,
Alessandro

5 Replies

JN Jayaleshwari N Syncfusion Team September 4, 2018 09:31 AM UTC

Hi Alessandro,  


 
Thanks for contacting Syncfusion support.  
 
We have checked the reported query from our end.  We would like to know that when SfListView is loaded inside any layout like Stacklayout, Grid with ColumnDefinitions or RowDefinitions is Auto, the height is not getting properly to ListView. So we have fixed this issue by setting the TotalExtent and minimum height to height of the ListView, so it's working in previous version. But this will break when loading the ListView in different layout with more than one children. So now we have fixed all the issues and it included in the current release. 
 
In current version, you can use below workaround for listview. Even the Xamarin Listview will have its default height similar to SfListView when items are less. We can customize SfListView Height initially while laoding and also at runtime by setting TotalExtent to HeightRequest . We have attached the sample and attached it in below link, Please find the sample.    
 
 
 listView.Loaded += ListView_Loaded;    
Addbtn.Clicked += Addbtn_Clicked1;    
           
private void ListView_Loaded(object sender, ListViewLoadedEventArgs e)    
{    
    var extent = visualContainer.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name =="TotalExtent").GetValue(visualContainer);    
    listView.HeightRequest = (double)extent;     
}    
            
private void Addbtn_Clicked1(object sender, EventArgs e)    
{    
    var contact = new Contacts();    
    contact.ContactName = "John";    
    contact.ContactNumber = "1243-23456";    
    viewModel.contactsinfo.Add(contact);    
    var extent = visualContainer.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name =="TotalExtent").GetValue(visualContainer);    
    listView.HeightRequest = (double)extent;    
}    
                                                                                                     
 
Please let us know if you require any further assistance.  
 
Regards,  
Jayaleshwari N


AD Alessandro Del Sole September 4, 2018 10:52 AM UTC

This did the trick!

Thank you very much.
Alessandro


JN Jayaleshwari N Syncfusion Team September 5, 2018 06:05 AM UTC

Hi Alessandro, 
 
Thanks for the update. 
We are glad to know that your issue has been resolved with our provided work around. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Jayaleshwari N.  



AD Alessandro Del Sole September 5, 2018 07:21 AM UTC

Sorry if I reopen the discussion, but I've noticed that, with longer lists, an extra white space is still added. Works fine instead with lists that have 20/30 items. Any hints would be really appreciated.

Thanks.
Alessandro


JN Jayaleshwari N Syncfusion Team September 7, 2018 03:54 AM UTC

Hi Alessandro,  
 
We would like to know that in previous versions when SfListView is loaded inside any layout like Stacklayout, Grid with ColumnDefinitions or RowDefinitions is Auto, the height is not set properly to ListView. So we have fixed this issue by setting the TotalExtent and MinimumHeightRequest to height of the ListView, so it's working in previous version. But this will break when loading the ListView in different layout with more than one children. So now we have fixed all the issues and it included in the current version.  
  
In current version(16.2.0.50), SfListView will have blank space at bottom when loaded in Grid with Row definition as Auto where device width will set as height for SfListView, as this the behavior of Sflistview and Xamarin ListView also holds the similar behavior.   
Can you please ensure us whether you have loaded SfListView inside Grid?.  
If that’s a case, you can overcome this by defining Grid with Row definition as or you can set HeightRequest for SfListView like below while loading.  
  
If the issue still exists even after RowDefinition as *, then we can setup a web meeting to look into it and provide the solution. Please let us know your availability. We will make every effort to have this scheduled on a date and time of your convenience.  
  
Regards,  
Jayaleshwari N 


Loader.
Up arrow icon