I am playing around with the treeview control and have run into a simple problem. I would like to set it up as everything that is divisible by 10 as being the parent node, then the numbers underneath should be the child nodes, until it reaches another divisible number by 10 without a remainder. So my method looks like this and needs help! Thanks.
private void countDown(int num)
{
tv_NumList.Nodes.Add("topNode");
while (num != 0)
{
if (num % 10 == 0)
{
tv_NumList.Nodes.Add(num.ToString());
int counter = 9;
while (counter != 0)
{
tv_NumList.Nodes[1].Nodes.Add(num.ToString());
counter--;
}
num--;
}
}
}
Maybe it is me, but I can’t see what you’re looking for… assuming you mean this (given 15)
The following would (untested) give you this result.