.NET 2.0 using VS2005
I'm trying to get this tree-view working properly.
Here's the directory structure on my c: in a specific folder
- Code: Select all
- Active
- Archive
|
|-- 04-05
|-- 05-06
|-- 06-07
Here's my code right now.
- Code: Select all
For Each _d As String In Directory.GetDirectories("C:\Change Request\")
Dim _folder As String = _d.Substring(_d.LastIndexOf("\") + 1)
tvListFolders.Nodes.Add(_folder)
Dim ThisDirectory As String = _folder
For Each _dd As String In Directory.GetDirectories("C:\Change Request\" & ThisDirectory)
Dim _dfolder As String = _dd.Substring(_dd.LastIndexOf("\") + 1)
tvListFolders.Nodes.Add(_dfolder)
Next
Next
And this is what display (see attachment) ... Now ... how do I get the 04-05, 05-06 and 06-07 folder moved under the Archived folder? instead of under "root"?
I would've thought the second for loop in there would give me that but .... obviously that didn't work. I think I need to assign something as parent but ... I'm new at .NET so ... explanation and help would be greatly appreciated.
Thanks