Hi,
we are using HierarchicalDataTemplate as follow:
<telerik:HierarchicalDataTemplate x:Key="TreeViewItemTemplate" ItemsSource="{Binding Path=Children}">
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