I have defined NodeLayout's as follows:
NodeLayout myLayout = new NodeLayout();myLayout.Key = "CompanyLayout";myLayout.TargetTypeName = "Company";myLayout.DisplayMemberPath = "company_name";
NodeLayout myLayout2 = new NodeLayout();myLayout2.Key = "SiteLayout";myLayout2.TargetTypeName = "SecurityApp.CAPs.Model.Site";myLayout2.DisplayMemberPath = "site_name";
MyTree.GlobalNodeLayouts.Add(myLayout);MyTree.GlobalNodeLayouts.Add(myLayout2);
But I'm only getting the top level Company name list in the tree display. Not seeing any expansion icons to the left of company name. I have checked everything I can think about. Compared to the example in the documentation, I can't see the differance. Any ideas on how to troubleshoot will be greatly appreciated.
Try chaning the key on your Site NodeLayout to be the property name on the object , so I think thats "Sites" in your case
Also, in case it matters, I'm using Infragistics Silverlight version 10.3, not 11.1
Follow-up on previous Post:
I have discovered that if I redefine the Site collection as a direct ObservableCollection<Site> rather than as a SiteCollection which derives from ObservableCollection<Site>, it works (that is, I can now see the Sites as children of Companies).
Is there a workaround for this short of redefining the Site collection as direct ObservableCollection<Site>??
I really need to specialize the ObservableCollection<Site> so I need SiteCollection.
Please help ASAP.
Thanks,
Joe
I am creating the NodeLayouts and assigning them to XamDataTree before setting its ItemsSource. Still have the problem. I have attached my Company.cs file because I'm wondering if the problem is due to the way my entities are defined. SiteCollection derives from ObservableCollection<Site> but for some reason Site is not being recognized as a target. Shouldn't this work?
I would have replied sooner but I've been trying every thing I can think of to no avail.
Thank you for your help,
Hi jgreen274,
I think the solution for your case is that you need to create those NodeLayouts and assign them to XamDataTree before setting its ItemSource. For example in the Loaded event of XamDataTree first create couple of NodeLayouts that adequate corespond to your objects and then set the ItemsSource to the XamDataTree. If you still have any difficulties please share them in order to assist you!
Regards,
Nikola