Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
60
XamDataTree does not respect ObservableCollections
posted

Hi, your XamDataTree does not work as expected.

This code doesn't show group2 under group1
---
      ObservableCollection<object> items = new ObservableCollection<object> ();

      var g1 = new AttributeGroupItem() {Name = "Level1"};
      var g2 = new AttributeGroupItem() {Name = "Level2"};

      
      g1.Items.Add (new AttributeItem () { Name = "L1 Child" });
      g2.Items.Add (new AttributeItem () { Name = "L2 Child" });


      g1.Items.Add (g2);

      items.Add (g1);

      this.xamDataTree1.ItemsSource = items;
---
But that code does!
---
      ObservableCollection<object> items = new ObservableCollection<object> ();

var g1 = new AttributeGroupItem() {Name = "Level1"};
var g2 = new AttributeGroupItem() {Name = "Level2"};
      g1.Items.Add (g2);
      
g1.Items.Add (new AttributeItem () { Name = "L1 Child" });
g2.Items.Add (new AttributeItem () { Name = "L2 Child" });



items.Add (g1);

this.xamDataTree1.ItemsSource = items;

---
My goal is to display Nodes recursively.

Regards
Benjamin

Parents Reply Children