Get the node extension as a tree

I have a treeview control that works like a folder browser. Since loading the entire folder structure from disk takes a lot of time, I try to load only one level at a time. Therefore, I have a function that adds nodes for all folders in the current node.

I thought the best way is to fire it in an event BeforeExpandin a tree.

UpdateTreeView(TreeView.SelectedNode);

does not work because hitting the + sign for extension also does not select node.

So how to find a node that is expanding.

+5
source share
1 answer

The event BeforeExpandshould work. It has TreeViewCancelEventArgswhich contains the property Node. Essentially an extension to node.

+8
source