This is a migrated thread and some comments may be shown as answers.

How to display a particular node

4 Answers 73 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bernard
Top achievements
Rank 1
Bernard asked on 04 Oct 2010, 04:14 PM
Hello,
I populate aRadreeview on the server with lot of nodes.
I would like to display the first checked node.
Is there any way to do that ?
Regards

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Oct 2010, 05:46 AM
Hi Bernard,


I am not quite sure about the requirement. If you want to access the first cehcked node in the treeview, then the following code will help you.

Client code:
function getChedcked() {
    var treeView = $find("<%=RadTreeView1.ClientID%>");
    var c = treeView.get_checkedNodes();
    alert(c[0].get_text());
}



-Shinu.
0
Bernard
Top achievements
Rank 1
answered on 05 Oct 2010, 07:44 AM
Hi Shinu,
Many thanks for your answer, but It's not what I am loooking for.
It's my fault because my english is limited !
I try again:
For example, I have 400 nodes to display in a Treeview.
The user can only see a few of them, and he has to scroll to see the others...
I would like to "position" the scroll (on server) so the 350th node (for example) is showned.

I hope you'll anderstand me.

Regards
0
Nikolay Tsenkov
Telerik team
answered on 07 Oct 2010, 10:39 AM
Hello Bernard,

Well you can find the first node using Shinu's approach, and then, you can call it's scrollIntoView method.

Hope this is helpful for you!


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
Bernard
Top achievements
Rank 1
answered on 07 Oct 2010, 03:53 PM
Hi Nikolay, Hello Shinu,

It's works. I didn't see this client method. I was looking to a (method or a proprety) on server. 

function

 

pageLoad()

 

{

 

    var tree= $find("<%= leftTV.ClientID %>");

 

 

    var c = tree.get_checkedNodes();

 

 

    if (c != null)

 

    {

        checkedNode = c[0];

 

        if (checkedNode != null)

 

        {

            var nodeElement = checkedNode.get_element();

 

            nodeElement.scrollIntoView();

        }

    }

}

Thank you both of you ! a evry helpful team !!
Bye

Tags
TreeView
Asked by
Bernard
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Bernard
Top achievements
Rank 1
Nikolay Tsenkov
Telerik team
Share this question
or