RadTreeView in RadComboBox - Scroll to selected node

7 posts, 0 answers
  1. Tricia
    Tricia avatar
    4 posts
    Member since:
    Aug 2006

    Posted 20 Oct 2008 Link to this post

    I have a radtreeview as a template item of a radcombobox.  I populate the treeview, select the proper treenode and set the text of the combobox in codebehind on the page load.  However, I can't seem to scroll either the combobox or the treeview to display the selected node. 

    I have tried executing a javascript on page load using the selectednode.scrollintoview() method, but that doesn't help

    For example, ff you look at your Travelissimo demo (http://demos.telerik.com/ASPNET/Prometheus/TreeView/Examples/Functionality/TreeViewComboBox/DefaultCS.aspx) , select Santiago from the dropdown and then click submit.  After the postback,  use the dropdown again.  You'll see that Santiago is selected, but you have to scroll to see it.    You'll notice that the scroll position is maintained if there is no postback.  My goal is to have Spain visible when the user clicks the dropdown following a postback.

    Any suggestions ?

  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 23 Oct 2008 Link to this post

    Hi Tricia,

    I have already replied to your support ticket:

    You need to set the Height of the treeview. Then subscribe to the OnClientDropDownOpened event of the combobox and define its handler as follows:

    function OnClientDropDownOpenedHandler(sender, eventArgs) 
        var tree = sender.get_items().getItem(0).findControl("RadTreeView1"); 
        var selectedNode = tree.get_selectedNode(); 
        if (selectedNode) 
        { 
            selectedNode.scrollIntoView(); 
        } 

    I hope this helps.

    All the best,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Danyal Rashid
    Danyal Rashid avatar
    7 posts
    Member since:
    Jul 2009

    Posted 12 May 2010 Link to this post

    I found out that the height of the tree must be in pixels. Height of 100% did not work for me.

    Hope this helps someone.
  5. Albert Shenker
    Albert Shenker avatar
    550 posts
    Member since:
    Mar 2004

    Posted 28 Jul 2010 Link to this post

    The scrollintoview method as used in the treeview in combobox example doesn't appear to work in Firefox 3.5.
  6. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 29 Jul 2010 Link to this post

    Hi Albert Shenker,

    Actually it seems that it's not working properly anywhere.
    Thank you for reporting this!

    I will make sure to log this bug and schedule it's fix release!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Murthy Meda
    Murthy Meda avatar
    3 posts
    Member since:
    Mar 2006

    Posted 09 Nov 2010 Link to this post

    Is it fixed? I am having the same problem.
  8. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 15 Nov 2010 Link to this post

    Hello Murthy Meda,

    Could you, please, try to use the following:
    node.get_element().scrollIntoView();

    Please let me know if this is not working for you and post an example reproducing the problem!

    I hope this will solve the problem!


    Regards,
    Nikolay Tsenkov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017