title: How can I bind a dataset directly to a TreeView (with hierarchy)?
body: <p>If I have a DataSet as a result of a SQL query, can I bind it directly to a TreeView and show the hierarchy of my data? I know I'd have to use several HierarchicalDataTemplates, but I don't know how to tell each one what data to display.</p>
  
  <p>If I have a 4-level hierarchy, like so:</p>
  
  <pre><code>&lt;HierarchicalDataTemplate x:Key="FirstLevelTemplate" ItemTemplate="{StaticResource SecondLevelTemplate}"/&gt;
  &lt;HierarchicalDataTemplate x:Key="SecondLevelTemplate" ItemTemplate="{StaticResource ThirdLevelTemplate}"/&gt;
  &lt;HierarchicalDataTemplate x:Key="ThirdLevelTemplate" ItemTemplate="{StaticResource FourthLevelTemplate}"/&gt;
  &lt;DataTemplate x:Key="FourthLevelTemplate"/&gt;
  </code></pre>
  
  <p>What property(ies) need to be set to display my data directly from a DataSet?</p>
  
  <p>edit: Ideally, I'd like to do this using a single self-referencing DataTable.</p>