Forum Xamarin Xamarin.Forms

Using ScrollTo() on xaml ListView ?

Lei12Lei12 Member ✭✭

Is it possible to call ScrollTo() on a ListView declared within a xaml ?
I've tried to give it x:Name but call still does not work



  • M_Shah04M_Shah04 USMember ✭✭✭

    You can try this out:

    In xaml: If your ListView's x:Name is listProducts ,

    In your xaml.cs file:

      listProducts.ScrollTo(listProducts.ItemsSource.Cast<object>().FirstOrDefault(), ScrollToPosition.Start, true);

    This will scroll your list to top.
    I have tried this one and its working fine.
    Hope this may solve your issue.

Sign In or Register to comment.