Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Multiple level treeview

$
0
0

Hi all,

I want a treeview with several level, but each time a different number of level.

I do : 

In xaml : 

<TreeView Name="TreeViewTask" ItemsSource="{Binding}" DataContext="{Binding}"><TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Path=Value}">

<TextBlock FontWeight="Bold" Text="{Binding Path=Key}" />

<HierarchicalDataTemplate.ItemTemplate><DataTemplate><TextBlock Text="{Binding}"/></DataTemplate></HierarchicalDataTemplate.ItemTemplate></HierarchicalDataTemplate></TreeView.ItemTemplate></TreeView>

And the code behind : 

TreeViewTask.DataContext = currentProg.Tests;

Where Tests is a dictionary of string / Object

Is it possible to make a treeview with several level in this way? (I don't know the number of level)

Thanks for your help !


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>