Node selected on page load

7 posts, 0 answers
  1. Rubihno
    Rubihno avatar
    86 posts
    Member since:
    Jun 2008

    Posted 08 Oct 2008 Link to this post

    Hi,

    How i make to select automatically a node when start page?For example a first node that find...
    Because the treeview when page start the node is not yet selected..i would like to select automatically a node..
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 08 Oct 2008 Link to this post

    Hi Rubihno,

    Here is one solution: On Page_Load event find the node and set its Selected property to True.

    Regards,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Rubihno
    Rubihno avatar
    86 posts
    Member since:
    Jun 2008

    Posted 08 Oct 2008 Link to this post

    I tried with this code..but dont'run...there are error..

     Dim selectednode As RadTreeView = New RadTreeView()

            selectednode.Nodes.FindNodeByValue(1).Selected = True
  4. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 08 Oct 2008 Link to this post

    Hello Rubihno,

    The FindNodeByValue method accepts a parameter of type String.
    Please change your code to:

    selectednode.FindNodeByValue("1").Selected = true

    Also, note that I have removed the .Node from your left side example, because in that way it will search only among the root nodes. Now it will search among all nodes.

    Regards,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Rubihno
    Rubihno avatar
    86 posts
    Member since:
    Jun 2008

    Posted 08 Oct 2008 Link to this post

    i have this error:

     selectednode.FindNodeByValue("1").Selected = True

    Object reference not set to an instance of an object.




  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 09 Oct 2008 Link to this post

    Hello Rubihno,

    I think the best way to proceed is to open a support ticket and send us a small running project demonstrating the problem.

    Thanks

    Kind regards,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Rubihno
    Rubihno avatar
    86 posts
    Member since:
    Jun 2008

    Posted 10 Oct 2008 Link to this post

    ok..thanks
Back to Top