In following snippet, I am trying to hide child node of a tree if there value does not exists in the list. Currently, I've 63 child nodes but the loop iterates for top 32 values. I couldn't make it running for full number of child nodes. I will be thankful if you suggest to diagnose the problem.
for (int i = 0; i < docTree.Nodes[0].ChildNodes.Count; i++)
{
if (tempList.Contains(docTree.Nodes[0].ChildNodes[i].Value))
{
}
else {
docTree.Nodes[0].ChildNodes.RemoveAt(i);
}
}