I need a tree that will go 4 node levels deep, i.e. Root-Child1-Child2-Child3. In some cases it will go only down 3 node levels.
For Root and Child1 I will need just a node label.
For Child2 I will need 5 labels of type: Icon1, Label, Icon2, Icon3 and Icon4. I understand that a Columnset can do this. Icon1 will be the node icon, icons 2, 3 and 4, are items that will indicate the type of data available for that node.
I want to do lazy loading since my warehouse contains 30 million records of different domains (types).
The system receives data in custom business objects that support IList, Collections, etc
Do I load the data directly into the tree or should I load data into tables first, so to be able to use the column sets more effectively and to use the relationships functionality? Is there a performance difference between using tables and using custom collections?
The example for loading on demand would probably work but it also uses tables but it doesn’t use the columnset_generated event. Can they be used together?
Do I need to use tables to be able to use the columnset_generated event?
Hi,
If you want to load the tree on-demand, then you probably don't want to do any data binding. The tree is pretty efficient about loading only what the level of data that it needs, but it will load the entire level plus one level more than is visible. So if you were to bind the root level of the tree, all root-level nodes and all child nodes would be loaded initially. I, of course, don't know your data structure, but my guess is that this is probably more than you want to load at once.
So my advice would be to load the nodes manually using the Load-On-Demand sample.
Since you will not be binding the tree, the three cannot automatically generate ColumnSets for you, which means you will need to create the ColumnSets yourself. But this is not terribly difficult and you can do it at design-time using the tree designer. Then you just have to assign the appropriate ColumnSet to the appropriate level of data. In this case, your first few levels don't need a ColumnSet, since they will just be standard-style nodes. To assign a ColumnSet to a particular level of data, you use the NodeLevelOverrides[x].ColmunSet.
Hi Mike,
Thank you very much for your advice. I've implemented and came up with exactly what I wanted, except for a tiny problem. I'm also sending you a screenshot of the problem. Let me explain on the hand of the screenshot:
If I collapse the "Berg" node and expand it again, the node label will show, but the node labels of "Breede" disappear. If I collapse and expand the "Breede" node, the "Berg" node labels disappears and the "Breede" node labels appear. It seems that I can only load one columnset at a time, which I don't want. The icons display correctly no matter what I do, so that's good. Any ideas?
Thanks
Casper
Hi Caspar,
I'm afraid I do not understand what you are describing. What are "the node labels"? What exactly is disappearing? And what do ColumnSets have to do with it?
no worries. I got it to work. The code that created the columnset was in the wrong place. Thanks.