Scroll down automatically after a item is expanded

5 posts, 1 answers
  1. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 20 Nov 2009 Link to this post

    Hi,

    I need the following scenario: when an item is expanded, i need to scroll down automatically so the item expanded appears at the top of the treeview.
    For example, when nothing is expanded, this looks like this:

    http://img517.imageshack.us/i/capturegt.png/

    But when I expand an item, this one appears automatically on top of the treeview, like this:

    http://img256.imageshack.us/i/capture2a.png/

    I've tried to play with BringIntoView, ScrollToVerticallOffset, etc.. but with no luck :(

    Any ideas ?


    Thanks !
  2. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 22 Nov 2009 Link to this post

    Nobody got an idea ?


    Thanks !
  3. DevCraft banner
  4. Answer
    Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 23 Nov 2009 Link to this post

    Hi Thomas,

    The reason why your scenario does not work the way you expect is because when you call BringIntoView on the "Playing The Angel" node, it is already into view. I have created a sample project that almost achieves the desired scenario. Have a look at it and let me know how it works for you.

    All the best,
    Kiril Stanoev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 23 Nov 2009 Link to this post

    Hi Kiril,

    Looks like perfect: I'll try it tomorrow and will let you know !


    Thanks !
  6. Thomas LEBRUN
    Thomas LEBRUN avatar
    66 posts
    Member since:
    Sep 2009

    Posted 24 Nov 2009 Link to this post

    Hi Kiril,

    This is perfect: thanks !


    Thomas
Back to Top
DevCraft banner