Highlighting node

3 posts, 0 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 08 Aug 2010 Link to this post

    I have a Save button on my form in the bottom center of my page. I have a treeview on the left.

    When I click on my Save button, I will perform some validation with some other items on the screen. If the validation passes, I would like the treeview on the left to set the color on the present node to red and then to move down to the next node in the tree.

    Question is, how do I get a reference to the treeview and those nodes from clicking my Save button in order to perform those functions?


  2. Veronica
    Veronica avatar
    1213 posts

    Posted 10 Aug 2010 Link to this post

    Hello William Yeager,

    You can access the RadTreeView directly via it's ID in the Save_Click handler. Here's a sample code:

    protected void Save_Click(object sender, EventArgs e)
            RadTreeNode currentNode = RadTreeView1.SelectedNode;
            currentNode.CssClass = "highlight";
            if (currentNode.Next != null)
                currentNode.Next.Selected = true;
            else if(currentNode.ParentNode != null)
                currentNode.ParentNode.Next.Selected = true;

    Have in mind that Next property returns the next node only for the current level.

    Please let me know if you have more questions.

    Kind regards,
    Veronica Milcheva
    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
  3. DevCraft R3 2016 release webinar banner
  4. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 11 Aug 2010 Link to this post

    Thanks Veronica. I appreciate it....
Back to Top