How to Iterate through TreeView
<p>I have TreeView Web Control like</p>

<pre><code>1
  1.1
2
  2.1
     2.1.1
          2.1.1.1
          2.1.1.2
3
  3.1 
     3.1.1
</code></pre>

<p>If i have checked [CheckBox] 2.1.1.2 node , how can i get the result like 2,2.1,2.1.1 and 2.1.1.2
<br/>
I have tried to use this <a href="http://msdn.microsoft.com/en-us/library/wwc698z7.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/wwc698z7.aspx</a> example but it doesnt give me required out put. Any Help or instructions how to achieve the required out put will be much appreciated.</p>

<pre><code>private void PrintRecursive(TreeNode treeNode)
{
   // Print the node.
   System.Diagnostics.Debug.WriteLine(treeNode.Text);
   MessageBox.Show(treeNode.Text);
   // Print each node recursively.
   foreach (TreeNode tn in treeNode.ChildNodes)
   {
      PrintRecursive(tn);
   }
}

// Call the procedure using the TreeView.
private void CallRecursive(TreeView treeView)
{
   // Print each node recursively.
   TreeNodeCollection nodes = treeView.CheckedNodes; // Modified to get the Checked Nodes
   foreach (TreeNode n in nodes)
   {
      PrintRecursive(n);
   }
}
</code></pre>
