RamzyEbeid
asked on
TreeView JavaScript
Dear Experts
i am using ASP.NET 2.0, C#, VS2005
i want to to check all child nodes of any parent,
and if i checked a child i want it parent to be autochecked
can you tell me how to do that
thank you
i am using ASP.NET 2.0, C#, VS2005
i want to to check all child nodes of any parent,
and if i checked a child i want it parent to be autochecked
can you tell me how to do that
thank you
this is how to check all the children
protected void TreeView1_SelectedNodeChan ged(object sender, EventArgs e)
{
TreeView tv = (TreeView)sender;
TreeNode tn = tv.SelectedNode;
CheckAllChildNodes(tn);
}
public void CheckAllChildNodes(TreeNod e child)
{
foreach (TreeNode n in child.ChildNodes)
{
n.Checked = true;
CheckAllChildNodes(n);
}
}
I am not sure how to post pack the page on check/uncheck) box
protected void TreeView1_SelectedNodeChan
{
TreeView tv = (TreeView)sender;
TreeNode tn = tv.SelectedNode;
CheckAllChildNodes(tn);
}
public void CheckAllChildNodes(TreeNod
{
foreach (TreeNode n in child.ChildNodes)
{
n.Checked = true;
CheckAllChildNodes(n);
}
}
I am not sure how to post pack the page on check/uncheck) box
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i am asking also how to post back the page when i check or uncheck the checkbox in the tree view control
thank you