Click here to Skip to main content
15,899,474 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
[Email removed to avoid spam]

I didn't find anywhere how to remove the child node from a parent node
of tree view.
I can removing the parent node as follows:
C#
System.Web.UI.WebControls.TreeNode tn = TreeView1.FindNode(Server.HtmlEncode("parent"));

But this is not applicable to child nodes of other parent nodes. It shows error node can't find but using removeat() method I am getting the index of a child node - but it is in sufficient for me.

Please review this.
Posted
Updated 20-Sep-10 5:30am
v2

1 solution

hey
you can use the following.
treeView1.Nodes["indexOfParentNode"].Nodes["indexOfChildNode"].Remove();


best of luck
Ahsan Sarfraz
 
Share this answer
 

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