treeview how to expand a fullpath c#
<p>I need to expand my treeview based on a fullpath in c#</p>

<p>My tree view has 2 nodes which are collapsed and I want to expand <code>Node A</code> to number <code>3</code>
so I have the fullpath of node <code>A\1\2\3</code>.</p>

<p>How can I step through and open each node based of the fullpath? Also the length of the fullpath may change, so i may need to open node be to <strong>level 6</strong>. So it needs to be done based on the fullpath. Any help would be great.</p>

<pre><code>Node A
       1
         2
          3



Node B
1
 2
  3
   4 5 6
</code></pre>

<p>This is what I've tried:</p>

<pre><code>TreeNode [] n= treeView1.Nodes.Find(search, true);

if (n.Length &gt; 0)
  found = true;
treeView1.Nodes[t].Collapse();
foreach (TreeNode p in n) {
  string[] a = p.FullPath.Split('\\');
  foreach (string b in a) {
    treeView1.SelectedNode = treeView1.Nodes[b];
    treeView1.SelectedNode.Expand();
</code></pre>
