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.
If I have a 4-level hierarchy, like so:
<HierarchicalDataTemplate x:Key="FirstLevelTemplate" ItemTemplate="{StaticResource SecondLevelTemplate}"/>
<HierarchicalDataTemplate x:Key="SecondLevelTemplate" ItemTemplate="{StaticResource ThirdLevelTemplate}"/>
<HierarchicalDataTemplate x:Key="ThirdLevelTemplate" ItemTemplate="{StaticResource FourthLevelTemplate}"/>
<DataTemplate x:Key="FourthLevelTemplate"/>
What property(ies) need to be set to display my data directly from a DataSet?
edit: Ideally, I'd like to do this using a single self-referencing DataTable.