HierarchicalDataTemplate multiple levels

5 posts, 0 answers
  1. Paco
    Paco avatar
    2 posts
    Member since:
    May 2011

    Posted 20 Jul 2011 Link to this post

    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

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 25 Jul 2011 Link to this post

    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!

  3. DevCraft banner
  4. khaldoun
    khaldoun avatar
    8 posts
    Member since:
    Jun 2011

    Posted 09 Dec 2011 Link to this post


  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 12 Dec 2011 Link to this post

    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 >>

  6. khaldoun
    khaldoun avatar
    8 posts
    Member since:
    Jun 2011

    Posted 12 Dec 2011 Link to this post

    it is ok it is fixed , thanks
Back to Top
DevCraft banner