I'm using this code from the another web:
How can I model this class in a database?
I have in each objective record a field named "Rank". It tells me what position is. For instance:
Objective "Geometry": Rank1
|_Objective "Squares": Rank1
|_Objective "Circles": Rank2
|_Objective "Triangle": Rank3
|_Objective "Types": Rank1
Objectve "Algebra": Rank2
Objective "Trigonometry": Rank3
That rank tells me the order of the nodes. But I want to get all the rank: For the third position will be:
Objective "Geometry": Rank1
|_Objective "Squares": Rank1 -> 1.1
|_Objective "Circles": Rank2
|_Objective "Triangle": Rank3
|_Objective "Types": Rank1 -> 1.3.1
Objectve "Algebra": Rank2
Objective "Trigonometry": Rank3 -> 3
I'm using LINQ to SQL. How can I do that?
<TreeView Name="treeView1">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate DataType="{x:Type data:Objective}" ItemsSource="{Binding Path=Objectives}" >
<TextBlock Text="{Binding Name}" />
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>