SfListView scrolling does not work correctly in UWP when adding elements at runtime, unable to adapt height correctly

SfListView scrolling does not work correctly in UWP when adding items at runtime. I have prepared an example, there are two objects "Block" and "Button" a block can have several buttons, so I have a SfListView with the source of blocks and inside I have another nested with the source of buttons, each block and each button have its own height, the SfListView of the block has the same height as the total height of all the buttons. This example works perfectly on Android but in UWP it has problems rendering the elements correctly at runtime the scroll works badly, I have prepared two videos to show how it works on both platforms:

Android (It works well):

https://www.youtube.com/watch?v=zvewGpWUV6Y

UWP (The scroll works badly):

https://www.youtube.com/watch?v=HEKlG1GcH8w

I have posted the example on GitHub:

Note: To create buttons at runtime you must have a block selected.

https://github.com/nacompllo/SfNestedsListView


16 Replies

SV Suja Venkatesan Syncfusion Team July 12, 2021 01:52 PM UTC

Hi Sergio, 

Thank you for contacting Syncfusion support, 

We would like to inform you that you can achieve your requirements by updating the HeightRequest for the inner ListView as mentioned below code snippet for UWP platform, 

Code Snippet: 
  public ExtendedListView() 
        { 
            if (Device.RuntimePlatform == Device.UWP) 
            { 
                this.container = this.GetVisualContainer(); 
                this.DataSource.SourceCollectionChanged += DataSource_SourceCollectionChanged; 
            } 
        } 
 
        private void DataSource_SourceCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 
        { 
            Device.BeginInvokeOnMainThread(async () => 
            { 
                var totalextent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(container => container.Name == "TotalExtent").GetValue(container); 
                this.HeightRequest = totalextent; 
            }); 
        } 

We have modified your sample and attached the workable sample with video in the following link, 


Please let us know if you need further assistance. 

Regards, 
Suja V 



UN Unknown replied to Suja Venkatesan July 12, 2021 02:10 PM UTC

Hi, first of all thanks, it works as expected. But I have found a strange behavior, when you select a button with the scroll down there is a flicker that makes you lose focus on the selected element and the scroll goes up this happens only in UWP, I attach a video to see what I say:

https://www.youtube.com/watch?v=YZ8X5LocKN0



UN Unknown replied to Suja Venkatesan July 12, 2021 03:17 PM UTC

Testing more deeply I have found another problem, when you update the height of an element of the DataTemplate at runtime the SFListview does not update its height so the elements are choppy.

I have prepared a video showing the problem alongside a Github repository:

Video:

https://www.youtube.com/watch?v=bM9_819Ftd8

GitHub sample:

https://github.com/nacompllo/SfNestedsListViewUpdated



SV Suja Venkatesan Syncfusion Team July 13, 2021 10:10 AM UTC

Hi Sergio, 

Sorry for the inconvenience caused. 

We have checked the reported issues, 

Regarding  “Flickering while Selecting a button with scrolldown” 
We would like to inform you that the reported issue is a framework level issue. Also we have logged issue report to Xamarin.Forms team. Please find the issue report in following link, 


Kindly follow the above bug report for further updates. 

Regarding  “Updating the height of the element of the DataTemplate at runtime of SfListView”  
You can achieve your requirements by updating the HeightRequest in container.Propertychanged event of innerlistview as mentioned in below code snippet for UWP platform. 

Code Snippet: 
 
this.container.PropertyChanged += Container_PropertyChanged; 
 
 
private void Container_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) 
        { 
            Device.BeginInvokeOnMainThread(async () => 
            { 
                var extent = (double)container.GetType().GetRuntimeProperties().FirstOrDefault(container => container.Name == "TotalExtent").GetValue(container); 
                if (e.PropertyName == "Height") 
                    this.HeightRequest = extent; 
            }); 
        } 
 

  
We have modified your sample and attached the workable sample with video in the following link, 


Please let us know if you need further assistance. 

Regards, 
Suja V. 



UN Unknown replied to Suja Venkatesan July 13, 2021 10:41 AM UTC

Hi, thanks for the work done. But I have found another problem that causes a crash, when you create multiple blocks at runtime and try to scroll the application crashes. It only happens when the ExtendedListView nested list has the IsScrollingEnabled property set to 'False', when it is set to 'True' it doesn't happen but the height of the lists look bad, I include a video along with an example on GitHub:

In the video I only show how to reproduce the crash, the error is not seen because I only record the UWP application, below I will include a photo of the error in the visual studio:

https://www.youtube.com/watch?v=tkxZ1HVkG10

Image from error:


crashSFListview.png


GitHub sample:

https://github.com/nacompllo/SfNestedsListView



SV Suja Venkatesan Syncfusion Team July 14, 2021 11:46 AM UTC

Hi Sergio, 
 
Sorry for the inconvenience caused. 
 
We have checked the reported issues, 
Regarding issue ”crash occurs while setting IsScrollingEnabled as false”  
 
We could able to reproduce the reported issue only with Xamarin.Form 5.0 version, but prior versions works properly. Currently, we validating the issue in our end. We will update the further details on or before 16th July 2021. We appreciate your patience until then. 
 
Regards, 
Suja V 



SV Suja Venkatesan Syncfusion Team July 16, 2021 12:34 PM UTC

Hi Sergio, 
 
We apologies for the delay .We have forwarded this to our development team. We will let you know once we got further updates from our development teams on or before 20th July 2021. We appreciate your patience until then.  
 
Regards, 
Suja V. 



SV Suja Venkatesan Syncfusion Team July 20, 2021 09:54 AM UTC

Hi Sergio, 

Thank you for your patience, 

We have analyzed the reported issue and logged bug report for the same. We will fix the issue and include the fix in our weekly nuget release which is scheduled on 10th August 2021. We appreciate your patience until then. 

You can also track the status of the report from the below link: 

Regards, 
Suja V. 




UN Unknown July 20, 2021 10:29 AM UTC

Thanks for everything. I also found another bug related to updating the element height of the SfListView runtime DataTemplate preventing it from updating properly. I have prepared a video that shows how to replicate it, you can use the same GitHub repository to replicate it.

Video:

https://www.youtube.com/watch?v=4H-faLUTNeM

GitHub sample:

https://github.com/nacompllo/SfNestedsListView



UN Unknown July 20, 2021 02:24 PM UTC

I have found more errors in the SFListview for macOS, when the page is displayed for the first time the nested SFListview does not show its elements, however as I show in the video if I change the size of the application window the elements appear. On the other hand, there is a problem when scrolling with many elements in the list since the scroll of the SFListview conflicts with the scroll of the parent, when in theory the nested SFListview has IsScrollingEnabled in false so it should not happen, which causes If you scroll too far down from the beginning of the list, it will be impossible for you to return since even the scroll bar disappears. I leave a video with these two errors and the GitHub repository I have updated it with the macOS example.

Video:

https://www.youtube.com/watch?v=jZ6iOnh_v-Y

GitHub sample:

https://github.com/nacompllo/SfNestedsListView



LN Lakshmi Natarajan Syncfusion Team July 22, 2021 03:17 AM UTC

Hi Sergio, 
 
Sorry for the inconvenience caused. 
 
We have checked the reported queries at our side. 
 
Query 
Response 
I also found another bug related to updating the element height of the SfListView runtime DataTemplate preventing it from updating properly.  
We could reproduce the reported scenario at our side. We are currently checking the same scenario further and update you the details on July 23, 2021. We appreciate your patience until then. 
I have found more errors in the SFListview for macOS, when the page is displayed for the first time the nested SFListview does not show its elements, 
We could not reproduce the reported scenario at our side, when using IsScrollingEnabled as False for the inner ListView. Please set the IsScrollingEnabled as False to overcome the reported scenario. 
On the other hand, there is a problem when scrolling with many elements in the list since the scroll of the SFListview conflicts with the scroll of the parent, when in theory the nested SFListview has IsScrollingEnabled in false so it should not happen, which causes If you scroll too far down from the beginning of the list, it will be impossible for you to return since even the scroll bar disappears. 
We could reproduce the reported scenario at our side. We need some more time to check on the scenario in our source level. We will check and update you further details on July 23, 2021. We appreciate your patience until then. 
 
Regards, 
Lakshmi Natarajan 



LN Lakshmi Natarajan Syncfusion Team July 24, 2021 10:38 AM UTC

Hi Sergio, 
 
Thank you for your patience. 
 
Query  
Response  
I also found another bug related to updating the element height of the SfListView runtime DataTemplate preventing it from updating properly.   
We have checked the reported scenario on our side. We would like to inform you that this issue is related to the below issue, 
 
 
We will ensure this case while fixing and the fix will be available as promised. We appreciate your patience until then. 
 
On the other hand, there is a problem when scrolling with many elements in the list since the scroll of the SFListview conflicts with the scroll of the parent, when in theory the nested SFListview has IsScrollingEnabled in false so it should not happen, which causes If you scroll too far down from the beginning of the list, it will be impossible for you to return since even the scroll bar disappears.  
Sorry for the delay caused. We could reproduce the reported in simple nested ListView sample itself. We are currently checking the scenario with our development team. We will update you further details on July 27, 2021 and appreciate your patience until then. 
 
Lakshmi Natarajan 
 



LN Lakshmi Natarajan Syncfusion Team July 27, 2021 12:22 PM UTC

Hi Sergio, 
 
Thank you for your patience. 
 
#Regarding there is a problem when scrolling with many elements 
 
We have analyzed the reported scenario in both source and framework level and the reported issue is a framework level issue. We could reproduce the same issue with simple nested ScrollView and we could not find any workaround for the same.  
 
We would like to inform you that, adding scrollable control inside the ScrollView is not recommended in Xamarin forms. The Xamarin.Forms warns the usage of nested ScrollView. You can refer to the following documentation regarding the same from the following links,  
 
 
Also, we have already logged an issue report related to the same to the Xamarin.Forms team.  
 
 
Kindly follow up with the above issue report for further updates. 
 
Lakshmi Natarajan 
 



LN Lakshmi Natarajan Syncfusion Team August 12, 2021 10:30 AM UTC

Hi Sergio, 
 
Sorry for the delay caused. 
 
#Regarding Nested ListView crash issue in XF 5.0 
 
We regret to inform you that due to the complexity in fixing the issue, we could not include the fix in our weekly Nuget release as promised. We will fix the reported issue and include it in our upcoming 2021 Volume 3 release which is planned to roll out in the end of September, 2021. We will let you once release rolled out and appreciate your patience until then. 
 
Lakshmi Natarajan 
 



LN Lakshmi Natarajan Syncfusion Team September 30, 2021 01:27 PM UTC

Hi Sergio, 
 
We regret for the delay caused.  
 
We regret in informing that there are going to be delays longer than expected in making this work. We are facing difficulties to fix this issue on framework level. We will include it in our 2021 Volume 3 SP release which is planned to roll out in the mid of October, 2021. We will let you once the release rolled out and appreciate your patience until then.  
 
Lakshmi Natarajan 
  
 



LN Lakshmi Natarajan Syncfusion Team November 8, 2021 05:01 AM UTC

Hi Sergio, 
 
Thank you for your patience. 
 
We have fixed the reported issue “Nested ListView crash issue in when IsScrollingEnabled is false in XF 5” and included the issue fix in our latest Weekly NuGet release update version 19.3.0.48 which is available for download (https://www.nuget.org/).  
 
Meanwhile, we would like to inform you that using IsScrollingEnabled as False and setting HeightRequest manually is not recommended in SfListView. We have modified the sample to achieve your requirement and attached in the following link, 
 
 
Also, we would like to inform you that using dynamic update in the inner ListView is not recommended. Please refer to our user guidance document regarding the limitation, 
 
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.    
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon