I have this:
<ig:XamTree Name="vwEqTree" Width="200"> <ig:XamTree.HierarchicalItemTemplate> <ig:HierarchicalDataTemplate x:Name="vwHClass"> <ig:HierarchicalDataTemplate.HierarchicalItemTemplate> <ig:HierarchicalDataTemplate x:Name="vwHMakes"/> </ig:HierarchicalDataTemplate.HierarchicalItemTemplate> </ig:HierarchicalDataTemplate> </ig:XamTree.HierarchicalItemTemplate> </ig:XamTree>
I would like to be able to populate the items manually with:
vwHClass.Items.Add
i.e. without the Templates I can populate the top list vwEqTree.Items.Add(obervablelist<item>)
That works, but breaks when I add the templates.
What does this look like?
Hello foxjazz,
I have been looking through your snippets and I can suggest you check the following sample from our feature browser which shows how you can add new item from code when you have hierarchicaldatatemplat. Please refer to the code bellow the sample
http://samples.infragistics.com/sllob/RunSamples.aspx?cn=tree#/tree/node-selection
If this doesn’t suit your scenario or if you have any additional questions on this matter please feel free to ask.
I guess I am not being very clear. Manually I mean from code-behind.
Currently I have a half ass app working populating manually, but I am getting double events firing.
i.e.
if (currXti.Level == 3 && currXti.Items.Count == 0) { currXtiType = (XamTreeItem)vwEqTree.ActiveItem; prdAppSVM.LoadTypes((vwYear) currXti.Tag); prdAppSVM.DisplayEqType += new EventHandler(prdAppSVM_DisplayEqType); } if (currXti.Level == 4 && currXti.Items.Count == 0) { currXtiModel = (XamTreeItem)vwEqTree.ActiveItem; prdAppSVM.LoadModels((vwType)currXti.Tag); prdAppSVM.DisplayEqModel += new EventHandler(prdAppSVM_DisplayEqModel); } if (currXti.Level == 5 && currXti.Items.Count == 0) { currXtiEngine = (XamTreeItem)vwEqTree.ActiveItem; prdAppSVM.LoadEngines((vwModel)currXti.Tag); prdAppSVM.DisplayEqEngine += new EventHandler(prdAppSVM_DisplayEqEngine); } if (currXti.Level == 6) { prdAppSub.ItemsSource = prdAppSVM.LoadAppSub((EqAll)currXti.Tag); } } void prdAppSVM_DisplayEqEngine(object sender, EventArgs e) { currXtiEngine.Items.Clear(); foreach (Entity vcls in prdAppSVM.lEqEngines) { XamTreeItem xti = new XamTreeItem(); EqAll eqa = (EqAll)vcls; xti.Header = eqa.EquipmentEngine; xti.Tag = eqa; currXtiEngine.Items.Add(xti); } } void prdAppSVM_DisplayEqModel(object sender, EventArgs e) { currXti.Items.Clear(); foreach (Entity vcls in prdAppSVM.lEqModels) { XamTreeItem xti = new XamTreeItem(); vwModel vwm = (vwModel)vcls; xti.Header = vwm.EquipmentModel; xti.Tag = vwm; currXtiModel.Items.Add(xti); } } void prdAppSVM_DisplayEqType(object sender, EventArgs e) { currXti.Items.Clear(); foreach (Entity vcls in prdAppSVM.lEqTypes) { XamTreeItem xti = new XamTreeItem(); vwType vwt = (vwType)vcls; xti.Header = vwt.EquipmentType; xti.Tag = vwt; currXtiType.Items.Add(xti); } }
My current implemntation is here:
foxjazz.net/pslite.zip
foxjazz.net/pslitedb.zip
The main thing I need is the template for the trees at all 6 levels.
Another thing I really need is to have expand indicators show on the TreeView at levels 5 and above.
And so when it is expanded, I can get the data dynamically and fill up the leaf from that level node.
Is there a way to do this without creating dummy nodes below to fool the tree into thinking it has nodes so the expander indicator shows?
I am not able to restore your database on my side, therefore I am not able to run your whole project. Would you please provide me with isolated test sample where I can research the mentioned behavior.
Thanks in advance.
The database is sql 2012. I do hope you are on the latest version of sql server.
Unfortunately the database and code have a close relationship with the things I am doing.
I have figured out how to auto-expand after populating the leafs.
So that issue can be marked resolved.
Hi Foxjazz,
I am also getting same issue. I am adding dummy node every time the child node expands and loads the remaining records as a child nodes.
I am getting no problem upto level 5 but when I load level6 data but the dummy node is not have the expandable icon to display rest of the records.
please suggest me any solution on this.
I want to know is it the limitation of xamTree to display only 6 levels of data?
Thanks!