title: Hide rootnode in treeview asp.net
body: <p>How can I hide the rootnode in this case the "temp" folder?
  I want to do this whitout setting a CssClass on the rootnode.</p>
  
  <pre><code>TreeView TreeView1 = new TreeView();
      protected void Page_Load(object sender, EventArgs e)
      {
          BuildTree(@"C:\temp");
          form1.Controls.Add(TreeView1);
      }
      private void BuildTree(string root)
      {
          DirectoryInfo rootDir = new DirectoryInfo(root);
          TreeNode rootNode = new TreeNode(rootDir.Name, rootDir.FullName);
          TreeView1.Nodes.Add(rootNode);
          TraverseTree(rootDir, rootNode);
      }
      private void TraverseTree(DirectoryInfo currentDir, TreeNode currentNode)
      {
          foreach (DirectoryInfo dir in currentDir.GetDirectories())
          {
              TreeNode node = new TreeNode(dir.Name, dir.FullName);
              currentNode.ChildNodes.Add(node);
              TraverseTree(dir, node);
          }
          foreach (FileInfo file in currentDir.GetFiles())
          {
              TreeNode nodeFile = new TreeNode(file.Name, file.FullName);
              currentNode.ChildNodes.Add(nodeFile);
          }
      }
  </code></pre>
  
  <p>The code is complete and redy to run just change the path to your desktop.</p>