Hello
Heres my data:
Person p = new Person()
{
Name = "Fred",
Friends = new ObservableCollection<Person>
new Person
Name="John",
Friends=new ObservableCollection<Person>
new Person{Name = "Paul"},
new Person{Name = "Ringo"}
}
},
Name="Alan",
new Person{Name = "Jane",
new Person{Name = "Harry"},
new Person{Name = "Gordon"}
new Person{Name = "Julie"}
};
Now, if I use a Microsoft Treeview with this template :
xmlns:windows="clr-namespace:System.Windows;assembly=System.Windows.Controls"
<windows:HierarchicalDataTemplate x:Name="template12"
ItemsSource="{Binding Friends}">
<StackPanel>
<TextBlock Text="{Binding Path=Name}" />
</StackPanel>
</windows:HierarchicalDataTemplate>
I get this :
But, if i use the the xamWebTree with this template:
<ig:HierarchicalDataTemplate x:Name="template1"
<ig:HierarchicalDataTemplate.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ig:HierarchicalDataTemplate.ItemTemplate>
</ig:HierarchicalDataTemplate>
Why doesn't the xamWebTree implement the n-level recursive binding in the same way the Microsoft Teeview does? What can I do to achieve this with the xamWebTree?
Thanks
Kevin
hey, Kevin, I think you can do it kind of the same way, like this:
<igTree:XamWebTree x:Name="dataTree" ItemsSource="{Binding Items}" > <igTree:XamWebTree.HierarchicalItemTemplate> <ig:HierarchicalDataTemplate ItemsSource="{Binding SubItems}"> <ig:HierarchicalDataTemplate.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image x:Name="myImage" Source="{Binding Image}" Margin="2" Height="12" Width="12" VerticalAlignment="Center" /> <TextBlock x:Name="myText" Text="{Binding Name}" VerticalAlignment="Center" /> </StackPanel> </DataTemplate> </ig:HierarchicalDataTemplate.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Image x:Name="myImage" Source="{Binding Image}" Margin="2" Height="12" Width="12" VerticalAlignment="Center" /> <TextBlock x:Name="myText" Text="{Binding Name}" VerticalAlignment="Center" /> </StackPanel> </DataTemplate> </ig:HierarchicalDataTemplate> </igTree:XamWebTree.HierarchicalItemTemplate> </igTree:XamWebTree>
Hope it works.
Paúl.