I have a set of directories under a folder. The directory structure isn’t 100% consistent (e.g. under A there maybe folders within folders but not under B).
I need to bind all the folders in a treeview with appropriate nesting (e.g. C:\a\b nests under C:\a).
Is there an easy way, or even free treeview, that would let me do this?
Thanks
Something like:
Just uses
Directory.GetDirectories()fromSystem.IOin a recursive method to build the node hierarchy, and drop this into the TreeView.EDIT – adding exclusion mechanism as per comments (and converted expression to Linq, which is clearer in this case):