title: Recursive TreeView in ASP.NET
body: <p>I have an object of type list from which I wish to use to populate a treeview in asp.net c#.</p>
  
  <p>Each object item has:</p>
  
  <pre><code>id | Name | ParentId
  </code></pre>
  
  <p>so for example:</p>
  
  <pre><code>id | Name     | ParentId
  -------------------------
  1  | Alice    | 0
  2  | Bob      | 1
  3  | Charlie  | 1
  4  | David    | 2
  </code></pre>
  
  <p>In the above example, the parent would be Alice having two children Bob and Charlie. David is the child of Bob.</p>
  
  <p>I have had many problems trying to dynamically populate the treeview recursively in c# ASP.NET</p>
  
  <p>Does any one have a simple solution?</p>
  
  <p>Btw: you can use People.Id, People.Name and People.ParentId to access the members since it is an object belonging to list.</p>
  
  <p>I can post you my code so far (many attempts made) but not sure how useful it will be.</p>