I have a treeview control that functions like a folder browser. Because loading the entire folder structer from disk is taking a lot of time i'm trying to load only one level at a time. So i have a function that adds nodes for all the folders in the current node.
I thought that the best method would be to run it on the BeforeExpand
event of the treeview.
UpdateTreeView(TreeView.SelectedNode);
is not working because clicking the + sign to expand is not selecting the node also.
So how to find the node that is expanding.
The BeforeExpand
event should work. It has a TreeViewCancelEventArgs
which contains a Node
property. It is essentially the node being expanded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With