How to display a particular node

5 posts, 0 answers
  1. Bernard
    Bernard avatar
    41 posts
    Member since:
    Jun 2010

    Posted 04 Oct 2010 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 05 Oct 2010 Link to this post

    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.
  3. Bernard
    Bernard avatar
    41 posts
    Member since:
    Jun 2010

    Posted 05 Oct 2010 Link to this post

    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
  4. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 07 Oct 2010 Link to this post

    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
  5. Bernard
    Bernard avatar
    41 posts
    Member since:
    Jun 2010

    Posted 07 Oct 2010 Link to this post

    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

Back to Top