I have to show a treeView with objects, where each of them has two list attributes. Sometimes one of the lists is empty. Can I suppress the BaseNode (in the shown example the RequirementsList) of an empty list?
The objects to be listed are based on the entityframework. For each list is a getter defined, who loads the list by ObjectQuery and returns the result as List.
Thanks: Rudi
Thanks for help.
It works very well, with EntityFramework too. There ist no noticeable performance implication.
Hi Rudi,
You could do something like this:
private void ultraTree1_InitializeDataNode(object sender, Infragistics.Win.UltraWinTree.InitializeDataNodeEventArgs e) { if (e.Node.IsBandNode && e.Node.Nodes.Count == 0) { e.Node.Visible = false; } }
This has a small performance implication since the tree now has to check for child nodes under every band node immediately when they are created. If you were binding to a DataSet, that could be an expensive operation. I don't know if the same is true of the EntiryFramework objects or not.