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?
Showing posts with label Nodes. Show all posts
Showing posts with label Nodes. Show all posts
Thursday, 3 May 2007
Subscribe to:
Posts (Atom)