This is a migrated thread and some comments may be shown as answers.
RadTreeView in RadComboBox - Scroll to selected node
6 Answers 382 Views
This is a migrated thread and some comments may be shown as answers.
Tricia
Top achievements
Rank 1
Tricia asked on 20 Oct 2008, 05:51 PM
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 ?

6 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 23 Oct 2008, 01:07 PM
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.
0
Danyal Rashid
Top achievements
Rank 1
answered on 12 May 2010, 08:43 PM
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.
0
Albert Shenker
Top achievements
Rank 1
answered on 28 Jul 2010, 02:22 PM
The scrollintoview method as used in the treeview in combobox example doesn't appear to work in Firefox 3.5.
0
Nikolay Tsenkov
Telerik team
answered on 29 Jul 2010, 07:08 PM
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
0
Murthy Meda
Top achievements
Rank 1
answered on 10 Nov 2010, 12:24 AM
Is it fixed? I am having the same problem.
0
Nikolay Tsenkov
Telerik team
answered on 15 Nov 2010, 11:59 AM
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
Asked by
Tricia
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Danyal Rashid
Top achievements
Rank 1
Albert Shenker
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Murthy Meda
Top achievements
Rank 1
Share this question
or