Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to Scroll to Top on Filter of ListView?

$
0
0

I have a SearchBar which is used to filter a ListView of data. If I scroll to the bottom or middle of the ListView then start entering data in the SearchBar to filter the list, I want to be able to automatically scroll to the top of the ListView so that it shows items at the top as the filter as applied.

I was thinking to use the ScrollTo method of the ListView on the Textchanged of the SearchBar to just ScrollTo first item in the list, but not sure how to get the item object of the ListView. It's an IEnumberable so I can't index it to get say the first item in the list. Am I heading in the right direction or is there a different way to do this?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>