tags:

views:

39

answers:

1

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.

+3  A: 

The BeforeExpand event should work. It has a TreeViewCancelEventArgs which contains a Node property. It is essentially the node being expanded.

Petar Minchev
ohh, how coud i miss that , thanks.
Iulian