Listview - Scroll to Selected Item

2 posts, 0 answers
  1. Ioannis
    Ioannis avatar
    6 posts
    Member since:
    Nov 2012

    Posted 28 Jun Link to this post

    Hello.

    I have a ListView which contains say 10 items. I add a new item programmatically, I am able to select it, but I am not able to make the Listview to Scroll to it.

    I found several examples for Grid scrolling to selection, but none of them works for ListView.

    Can you please provide some assistance?

    Thanks,

    Kyriakos

     

  2. Stefan
    Admin
    Stefan avatar
    1137 posts

    Posted 03 Jul Link to this post

    Hello Kyriakos,

    In general, the ListView does not provide a scrolling functionality out of the box. If the DIV container has to be scrolled this can be achieved with the standard jQuery scrollTop method.

    This will require a manual calculation for the scroll position based on which item in the list is selected.

    Also, I can suggest checking the following third-party library which can be helpful in this scenario:

    https://github.com/flesler/jquery.scrollTo

    I hope this is helpful.

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top