Set focus to a node in RadTreeView

2 posts, 0 answers
  1. Sidhant
    Sidhant avatar
    4 posts
    Member since:
    May 2016

    Posted 17 May 2016 Link to this post

    I have a RadSplitter which house 2 vertical RadPanes both with scroll bars.

    The first pane has a RadTreeView inside a .Net User control and the second pane has an IFrame.

    I need to set focus on a particular node in the RadtreeView when the page is loaded so I don't have to scroll endlessly to reach that node when the page is first loaded.

    I tried using the following approach but it is not working :

    function scrollToNode(){
            var selected = $(".rtSelected");
            if(selected.length > 0){
            var TotalScrollNeeded = selected.offset().top
                - $("#radTree").offset().top
                + $("#radTree").scrollTop();
            $("#radTree").animate({ scrollTop: TotalScrollNeeded }, 1000);

  2. Ivan Danchev
    Ivan Danchev avatar
    1617 posts

    Posted 19 May 2016 Link to this post

    Hello Sidhant,

    You can try the following approach to scroll to the initially selected TreeView node, which uses the RadTreeView and RadTreeNode client-side methods:
    function pageLoad() {
    function scrollToNode() {
        var tree = $find('<%= RadTreeView1.ClientID %>');
        var node = tree.get_selectedNode();
        if (node) {

    Ivan Danchev
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top