I'm trying to add a TreeView Node
to the path, for example:
And the code I'm trying is like this:
public void AddParent(string path, string node)
{
TreeNode parentNode = treeView1.Nodes[path];
if (parentNode != null)
{
parentNode.Nodes.Add(node);
}
}
Ex path: Node0 \ Node1 \ Node2 Ex node: Test
But parentNode always returns null
.
Can anyone help me?