Checking all child nodes of a treeview when parent node checked using C# (c-sharp)
It will also expand the parent node to show the children.
private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
{
if (e.Node.Checked)
{
foreach (TreeNode nd in e.Node.Nodes)
{
nd.Checked = true;
}
//Expand tree node now
e.Node.Expand();
}
}
It's easy guys isn't it?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment