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

Selecting only parent node?

1 Answer 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
V
Top achievements
Rank 1
V asked on 28 Jun 2010, 07:56 PM
After trying for hours to accomplish something that in theory should be a simple task, i've decided to turn to the forums for help!

I have a tree view (with checkboxes) with ONE parent node, and multiple child nodes.

I also have an asp:OptionButtonList, with three options: Full, Partial, and None.

If a user clicks "Full", the Parent node and child nodes should be checked.

If a user clicks "Partial", only the Parent node should be checked...no child nodes.

And, obviously, if a user clicks "None", no nodes should be checked.

I can get the Full and None options to work...but not the partial.

Can anyone help?

So far i'm doing this:

switch (rbl.SelectedValue)  
            {  
                case "FullToHMHS":  
                    radTreeView.CheckAllNodes();  
                    return;  
                case "FullToOther":  
                    isChecked = false;  
                    break;  
                case "Partial":  
                    isChecked = false;  
                    break;  
                default:  
                    break;  
            }  
 
            foreach (RadTreeNode node in radTreeView.Nodes)  
            {           
                node.Checked = isChecked;                  
            } 

obviously this isn't going to accomplish what I want for the "Partial" option, but i've tried what seems like a billion different things, and I can't seem to just check the Parent Node...

Thanks in advance!
V

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 01 Jul 2010, 01:37 PM
Hi V,

This post is duplicated. Your question is already been answered.


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
Tags
TreeView
Asked by
V
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or