Hi!
I've a problem building up a ComponentOne TreeView in Silverlight (C1TreeView) with a C1HierarchicalDataTemplate. In detail the Tree only shows 2 levels (H1 and H2), although 3 levels are defined through HierarchicalDataTemplates like:
<c1:C1HierarchicalDataTemplate x:Key="H3Template">
<TextBlock FontWeight="Bold" Text="{Binding Path=Name}" />
</c1:C1HierarchicalDataTemplate>
<c1:C1HierarchicalDataTemplate x:Key="H2Template" ItemsSource="{Binding Path=H3Items}" ItemTemplate="{StaticResource H3Template}">
<TextBlock FontWeight="Bold" Text="{Binding Path=Name}" />
</c1:C1HierarchicalDataTemplate>
<c1:C1HierarchicalDataTemplate x:Key="H1Template" ItemsSource="{Binding Path=H2Items}" ItemTemplate="{StaticResource H2Template}">
<TextBlock FontWeight="Bold" Text="{Binding Path=Name}" />
</c1:C1HierarchicalDataTemplate>");
I'm using this Templates in a Custom TreeView (derived from C1TreeView):
<c1:C1TreeView ... ItemTemplate="{StaticResource H1Template}">
</c1:C1TreeView>
The constructor of this TreeView looks like this:
public MyTreeView(ObservableCollection<H1> h1Items)
{
InitializeComponent();
ItemsSource = h1Items;
}
Can anybody see the error in these code snippets??
thx, Dom