treeview question c# win form
-
hi to all, i have a treeview with some nodes with checkboxes when the user check or uncheck a parent node, i want to check or uncheck all the child nodes (child nodes are maybe checked or unchecked) can someone post some code sample best regards and thanks in advance fady
-
hi to all, i have a treeview with some nodes with checkboxes when the user check or uncheck a parent node, i want to check or uncheck all the child nodes (child nodes are maybe checked or unchecked) can someone post some code sample best regards and thanks in advance fady
Hi! You can solve this task by using a simple recursive function:
void CheckChildNodes(TreeNode parent, bool checked)
{
parent.Checked = checked;
foreach (TreeNode nd in parent.Nodes)
CheckChildNodes(nd, checked);
}Regards, mav
-
Hi! You can solve this task by using a simple recursive function:
void CheckChildNodes(TreeNode parent, bool checked)
{
parent.Checked = checked;
foreach (TreeNode nd in parent.Nodes)
CheckChildNodes(nd, checked);
}Regards, mav
thanks a lot mav fady