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
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
Hi Benjamin,
I was wondering if you needed any further help with this question.
If so, please feel free to contact me.
I believe the issue with your recursive data design is caused by the generic collection type being used to determine the NodeLayout for a level rather than using the type of the individual data item.
You could move the collection down in some way or make the collections all AttributeGroups (your derived class).
Let me know if you have further questions.
I’m going over your sample and also looking for information about handling recursive data for the xamDataTree.
When I run your sample I see parent and first level child nodes. However, when you are adding the AttributeGroup within the child it doesn’t appear to be recognizing that it should be parent level to the subsequent Attribute items.
I will post back here when I have more information.
sorry I've been busy this week
the hole project is attached to this post
maybee you can found out what's wrong with my code
thx
benjamin
I didn’t hear back from you. Let me know if I can be of any further assistance.