I want to dynamically add some child nodes to a root node in my TreeView. I have a string Array of some names like {\"john\", \"sean\", \"edw
You need to append the child node to the parent, here's an example:
TreeView myTreeView = new TreeView();
myTreeView.Nodes.Clear();
foreach (string parentText in xml.parent)
{
TreeNode parent = new TreeNode();
parent.Text = parentText;
myTreeView.Nodes.Add(treeNodeDivisions);
foreach (string childText in xml.child)
{
TreeNode child = new TreeNode();
child.Text = childText;
parent.Nodes.Add(child);
}
}