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

Calling OnPropertyChanged on the property used for sorting and/or grouping moves the scroll position

Hey.

I have an ObservableCollection of objects bound to an SfListView and I use some of the properties on the objects in the list to sort and group the list using SortDescriptors and GroupDescriptors with LiveDataUpdateMode enabled, to be able to refresh the items in the list silently in the background without the user noticing, but when calling OnPropertyChanged on the properties used for sorting and/or grouping on the objects in the list to update the items in list, the scroll position changes more or less, which is undesirable as it disrupts/confuses the user and makes the silent refresh not so silent.

Through some testing I've distilled my problems down to 2 main issues:

Issue 1
When AutoFitMode=Height on the SfListView and OnPropertyChanged is called on the property used for sorting with LiveDataUpdateMode enabled and/or the property used for grouping, then the scroll position will move unpredictably at random, if you've scrolled away from the very top of the list. The issue happens less frequently with the property used for grouping than it does with the property used for sorting, but it happens with both.

Issue 2
When AutoFitMode=None, when the very last item in an SfListView is visible, either partially or fully, and OnPropertyChanged is called on the property used for sorting with LiveDataUpdateMode enabled and/or the property used for grouping, then the scroll position exactly moves up to the second to last item, leaving the very last item out of view. When AutoFitMode=Height and scrolled all the way to the bottom when calling OnPropertyChanged, then the scroll position will move more violently and unpredictably.

Are there any workarounds for these issues to stop the scroll position from moving around and is this something you can potentially address in a future release?

I've prepared a sample for you guys to play around with these issues that I've attached to this post.

Thanks in advance!

Attachment: SfListViewSample_Scroll_Sorting_Grouping_Problem_1388e116.zip

3 Replies

DB Dinesh Babu Yadav Syncfusion Team July 15, 2019 10:58 AM UTC

Hi Morten, 
 
Thanks for using Syncfusion support. 
 
We have confirmed that reported issue is a defect in SfListView and logged a defect report for the reported issue. The fix will be included in our upcoming weekly Nuget release which is expected to be rolled out on July 30, 2019. We will appreciate your patience until then. 
 
Meanwhile, you can track the status of the bug report from below feedback. 
 
 
Regards, 
Dinesh Babu Yadav 



DB Dinesh Babu Yadav Syncfusion Team July 30, 2019 05:11 PM UTC

Hi Morten, 
 
We are glad to announce that our latest weekly NuGet package update version 17.2.0.39 has been rolled out and the reported issue has been resolved and it is available for download (nuget.org).        
 
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.     
 
Regards, 
Dinesh Babu Yadav 



DB Dinesh Babu Yadav Syncfusion Team July 30, 2019 06:14 PM UTC

Hi Morten, 
 
We have analyzed the issue and it occurs due to auto fit mode setting of SfListView. When you are changing property which is sorted or grouped, the records will get removed and added again. The auto-fit size calculation will be done only for visible items. So, if we remove the item which is not visible and add it again in the non-visible region, then the size of the item reset the ItemSize. So, the scroll changes happening.  
 
Now we have fixed unnecessary refreshes where the scroll changes will not happen when the item is not really moved to different position our latest weekly NuGet package update version 17.2.0.39. It has been rolled out and it is available for download (nuget.org). You can optimize the scroll changes by setting ItemSize to a nearby value of auto fit size items.  
 
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. 
 
Regards, 
Dinesh Babu Yadav 


Loader.
Live Chat Icon For mobile
Up arrow icon