Reputation: 403
I have to find some node and child node in a tree view.Below code is only find the main node of the tree view.Then how can I find the child node
foreach(var id in values)
{
TreeNode node =TreeView1.FindNode(Server.HtmlEncode(id.ToString()));
if(node!=null)
{
node.Checked = true;
}
}
Upvotes: 0
Views: 651
Reputation: 820
Try This
TreeNode node = TreeViewProducts.FindNode(nodeID);
foreach (var childNode in node.ChildNodes)
{
}
Upvotes: 1