This is a migrated thread and some comments may be shown as answers.

HierarchicalDataTemplate multiple levels

4 Answers 59 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paco
Top achievements
Rank 1
Paco asked on 20 Jul 2011, 02:14 PM
Hi,
we are using HierarchicalDataTemplate as follow:

<telerik:HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding Path=Children}">

<StackPanel Orientation="Horizontal">

<TextBlock Text="{Binding Path=DescripcionArticulo}" FontSize="8" FontWeight="Normal"/>

</StackPanel>

</telerik:HierarchicalDataTemplate>

Then we dynamicaly create a tree in C# like this:

RadTreeView tree = new RadTreeView();

tree.ItemTemplate = this.Resources["TreeViewItemTemplate"] as Telerik.Windows.Controls.HierarchicalDataTemplate;

tree.Selected += new EventHandler<RadRoutedEventArgs>(this.RadTreeViewItem_Selected);

ObservableCollection<treeProductoViewModel> listaItems = new ObservableCollection<treeProductoViewModel>();

listaItems = generarLista(data, data[i][1]);

tree.ItemsSource = listaItems;

and get only 2 levels. Can you help? Thanks

4 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 25 Jul 2011, 12:43 PM
Hello Paco,

 We cannot see something unusual in the code you provided. So we would be better able to assist you if you send us more from your code (generating the Hierarchy, XAML, ViewModels) ? TThank you for your cooperation in advance.

Best wishes,
Petar Mladenov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
khaldoun
Top achievements
Rank 1
answered on 09 Dec 2011, 10:25 PM

0
Petar Mladenov
Telerik team
answered on 12 Dec 2011, 01:15 PM
Hi Khaldoun,

 Could you please re-send you post ? We can only see a blank code snippet in your post from 9.12.2011.
Thank you in advance.

All the best,
Petar Mladenov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
khaldoun
Top achievements
Rank 1
answered on 12 Dec 2011, 03:31 PM
it is ok it is fixed , thanks
Tags
TreeView
Asked by
Paco
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
khaldoun
Top achievements
Rank 1
Share this question
or