Safeena
Safeena

Reputation: 403

how to find treeview node ans childnode

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

Answers (1)

Rajeev Mehta
Rajeev Mehta

Reputation: 820

Try This

TreeNode node = TreeViewProducts.FindNode(nodeID);
foreach (var childNode in node.ChildNodes)
{

}

Upvotes: 1

Related Questions