Autoscroll the Listbox / Gridview

3 posts, 0 answers
  1. Dirk
    Dirk avatar
    2 posts
    Member since:
    Mar 2017

    Posted 20 Jun Link to this post

    Hello,

    i used your example of the documentation, about the RadCollectionNavigator, but I did not found any information how to autoscroll the Listbox, if the MovetoNextButton or MoveToLastItem is clicked and the Listbox size is to small to show all item without scrollbar.

    Does the Controls have such kind of feature out of the box and best case MVVM friendly? Or do you have any suggestion how to implement this feature for a good customer experience? If possible I would like to avoid the datapager control.

    Best regards,

    Dirk

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    603 posts

    Posted 23 Jun Link to this post

    Hello Dirk,

    In order to achieve the desired behavior, you can handle the SelectionChanged event of the ListBox like so:

    private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
        var listbox = sender as ListBox;
        var item = e.AddedItems[0];
        listbox.ScrollIntoView(item);
    }

    Please let me know if this works for you.

    Regards,
    Dilyan Traykov
    Progress Telerik
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Dirk
    Dirk avatar
    2 posts
    Member since:
    Mar 2017

    Posted 27 Jun in reply to Dilyan Traykov Link to this post

    Hello Dilyan,

    works well.

     

    Bets regards,

    Dirk

Back to Top