Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Treeview > TreeView Scroll Into View
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

TreeView Scroll Into View

Feed from this thread
  • Control_Freq avatar

    Posted on Jun 27, 2007 (permalink)

    Hi,
    In codebehind I can select a RadTreeNode like this:

    //SPTree.Nodes

    RadTreeNode rtn2 = SPTree2.FindNodeByText(dr["sStoredProcedureName"].ToString());

    if (rtn2 != null)

    {

    rtn2.Selected = true; // select it.

    }

    However, if there are lots of nodes on this tree then my selected node may not be visible. I need something like a ScrollIntoView method, or similar.
    How to get it to work in codebhind?

    Thanks

  • Nick Nick admin's avatar

    Posted on Jun 27, 2007 (permalink)

    Hello Control_Freq,

    There is no such method on the server-side. You should use client-side logic to accomplish your task. For example, you can hook on the onload event of the body element and scroll to the selected node. Please check the following help article that shows the needed approach:
    Scrolling To The selected node

    Hope this helps.

    Regards,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Control_Freq avatar

    Posted on Jun 27, 2007 (permalink)

    Well, I need to do this in response to other events, so the onLoad method doesn't do what I want.

    I think I will redesign my webpage so that I don't need this functionality. I have found in the past that if telerik controls don't do what I want, then it is quicker to start again, from the start, than to start banging head against the wall.

    Thanks anyway.

  • Nick Nick admin's avatar

    Posted on Jun 27, 2007 (permalink)

    Hi Control_Freq,

    There is something else that has just came to my mind. RadTreeView has a RetainScrollPosition property that should retain the scroll position of the selected node. Please make sure that this property is enabled.

    All the best,
    Nick
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  • Posted on Mar 24, 2011 (permalink)

    Is this property gone?  I Don't see it anymore and it doesn't exist in the class when I try and use it in C#.  I saw a page of docs for it, but when I got to the RadTreeView member variables it doesn't exist.  Is there a new way to handle this?

    Thanks!
    Ben

  • Helen Helen admin's avatar

    Posted on Mar 25, 2011 (permalink)

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Treeview > TreeView Scroll Into View