title: C# Tree view List child nodes
body: <p>I'm having trouble getting all the child nodes listed correctly. I have a list of "employees" that has a list inside that is for hardware checked out. The Employee names and id show just fine. I just can't get more than 1 of the hardware checked out showing.</p>
  
  <p>Here is what I have so far.</p>
  
  <pre><code>private void PopulateTreeView()
      {
          // sorts the fields by ascending order.
          frmCheckOut.checkedOutItem.SortList();
  
          // Clears the Tree View so there is no duplicate entries.
          tvInventory.Nodes.Clear();
  
          TreeNode date = new TreeNode();
          TreeNode[] nodeArray = new TreeNode[1];
          TreeNode itemDescription = new TreeNode();
          TreeNode[] nodeArray2 = new TreeNode[1];
          TreeNode treeNode = new TreeNode();
  
          foreach(CheckOutItem item in frmCheckOut.checkedOutItem.itemCollection)
         {
              foreach (Hardware h in item.hardware)
              {
                  date = new TreeNode(h.Date);
                  nodeArray = new TreeNode[] { date };
                  itemDescription = new TreeNode(h.HName + ": " + h.TagNumber, nodeArray);
                  nodeArray2 = new TreeNode[] { itemDescription };
              }
  
              treeNode = new TreeNode(item.EmpNumber + " " + item.LastName + ", " + item.FirstName + "&lt;" + item.Email + "&gt;", nodeArray2);
  
              tvInventory.Nodes.Add(treeNode);
  
          }
      }
  </code></pre>
  
  <p>Any idea what I'm doing wrong?</p>