Click here to Skip to main content
15,886,004 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi!
i have a treeview and node: "check all". When i check it, all nodes parent are checked.
Can you help me? Plz. Thank you so much :).
Posted
Comments
DamithSL 26-Aug-15 1:18am    
what have you tried so far? what is the project type or full name of treeview control?
nltd 26-Aug-15 2:08am    
thank you. i have done it.
Sergey Alexandrovich Kryukov 26-Aug-15 1:45am    
TreeView? Which one? Full type name, please. And what's the problem?
What have you tried so far?
—SA
nltd 26-Aug-15 2:09am    
^^ thank you :).
i tried:
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
{
if (e.Node.Checked)
{
if (e.Node.Text == "check all")
{
if (treeView1.Nodes.Count > 0)
{
for (int i = 0; i < treeView1.Nodes.Count - 1; i++)
{
treeView1.Nodes[i].Checked = true;
foreach (TreeNode child in treeView1.Nodes[i].Nodes)
{
child.Checked = true;
}
}
}
}
}
}
Sergey Alexandrovich Kryukov 26-Aug-15 9:30am    
Didn't I ask you to specify the type name?
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900