adding a treeview into a treeview RRS feed

  • Question

  • Hi,

    is possible to add in codebehind a treeview into another treeview.

    I mean, I have two XAML treeviews, and only one of its have data. Well, what I want is:

    //after InitializeComponent()




    is there any way to do this or simply is impossible??



    Friday, April 20, 2007 10:49 AM


  • Ok, I've got it.


    Code Snippet

    TreeViewItem tvi = new TreeViewItem();

    tvi.Header = "Head";

    tvi.ItemsSource = this.DataTree.ItemsSource;
      tvi.ItemTemplateSelector = this.DataTree.ItemTemplateSelector; //this one if your data tree have groups


     Nothing more, bye

    Friday, April 20, 2007 11:38 AM