0
votes

I have this devexpress treeview which have a list of nodes attached to it and it will display the expand/collapse button if the node has any subnodes. My problem is there can be hundreds of nodes and couple of dozen subnodes inside it. So Im loading the subnodes on when im clicking on the node so at the time the treeview is created there aren't any subnodes to it. So user cannot see if there are any subnodes until the user click on the node itself. I have a workaround in which I populate each of the nodes with a dummy node. This works as expected but its still a bit heavy. Is there anyway to suggest the treeview to accept that there are children for that treeview.

I know its possible in treelist

TreeListNode.HasChildren

Is this possible in treeview?

1

1 Answers

0
votes

As It turns out the best possible solution for the above problem is using a virtual treeview. Since the virtual treeview allow to mark a node a as leaf so when it is not marked as a leaf the expand/collapse button is made visible.

Other way is to just to use the workaround and a create a dummy node for each usernode created and have ExpandedChanged event written to remove the dummy node and load the actual subnodes.

Hope this helps anyone in the future who are looking do something like this Cheers.