Selecting nodes programatically

2 posts, 0 answers
  1. Phi
    Phi avatar
    19 posts
    Member since:
    Jun 2007

    Posted 01 Jul 2007 Link to this post


    I want to be able to set the "Selected" property of a node, before I add it to the RadTreeView.

    The following code will NOT select the node:

    RadTreeNode node1 = new RadTreeNode("node1");
    node1.Selected = true;

    but if I set the "Selected" property *afterwards*, it will work

    RadTreeNode node1 = new RadTreeNode("node1");
    node1.Selected = true;

    Is this a bug or by design. If by design can you explain the reasoning behind this?

    Phi Le

  2. Boyko Markov
    Boyko Markov avatar
    610 posts

    Posted 03 Jul 2007 Link to this post

    Hello Phi,

    That behavior is by design. You should set the Selected property of RadTreeNode after you have already added the node to a treeview.

    If you need more information please write back.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. DevCraft banner
Back to Top