I am looking for a little help using the tree control. I have a ObservableCollection of nodes in a hierarchy on my ViewModel
i.e each node has a Childrens Collection.
I then bind the xamWebTree to the nodes collection. Looking at the examples I have defined a HierarchicalItemTemplate.
But this only shows not 1 level deep. I was expecting it to use the template n levels deep ? is this possible ?
<igTree:XamWebTree x:Name="contextTree" ItemsSource="{Binding TNodes}">
<igTree:XamWebTree.HierarchicalItemTemplate >
<ig:HierarchicalDataTemplate ItemsSource="{Binding Children}">
<DataTemplate>
<TextBlock Text="{Binding name}" Margin="5,0,0,0" />
</DataTemplate>
<ig:HierarchicalDataTemplate.ItemTemplate>
<DataTemplate >
<TextBlock Text="{Binding name}" Foreground="Gray" Margin="5,0,0,0" />
</ig:HierarchicalDataTemplate.ItemTemplate>
</ig:HierarchicalDataTemplate>
</igTree:XamWebTree.HierarchicalItemTemplate>
</igTree:XamWebTree>
Thanks
Marcus
This line>
amarendraboddu said:
DataTemplate tpl = (DataTemplate)this.Resources["MyDataTemplate"];
Is probably declared in his user control Resources.
<UserControl.Resourses>
<DataTemplate x:Key="someKey">
<....Elements...>
</UserControl.Resourses>
The sample "Using Custom Icons" under "XamTree" at
https://es.infragistics.com/samples/silverlight
shows this being used.
Hi,
I am also facing the same issue that is mentioned above. Can you provide the explanation for the below code:
Where i need to add the above mentioned resouce? If there is any sample code please share with us.
And also can some body provide the sample for the below mentioned:
<igTree:XamWebTreeItem CollapsedIcon="{Binding CollapsedIcon}" ExpandedIcon="{Binding ExpandedIcon}"></igTree:XamWebTreeItem>
Thanks in Advance.
Regards,
Amarendra.
I am trying to create the tree hierarchy dynamically. Can you please explain the below code:
If you are using a resource "MyDataTemplate" ,can you please provide the template code. Is it possible to provide a working sample of the same?
Thanks,
Suman.
Stoimen
It would be helpful if you would add the definition of "MyDataTemplate", and add some comments to the code.
We've talked internally about ways we can add this feature to the control, but currently we have not assigned the work to any specific release.
Devin