For example if I have a List = {"A", "B", "C"}, I want the treeview to be
+Root
-A
-B
-C
I tried
<TreeView>
<TreeViewItem Header ="Root">开发者_运维百科;
<TreeViewItem ItemsSource="{Binding Path=List}"/>
</TreeViewItem>
</TreeView>
but the result is
+Root
- (just an empty node)
-A
-B
-C
which is not what I want
Try this:
<TreeView>
<TreeViewItem Header ="Root" ItemsSource="{Binding Path=List}"/>
</TreeView>
精彩评论