Hi everyone.
As the title states I'm trying to display in a treeview the subitems of a folder from listview.
The listview works somewhat like an explorer and I just pick the folders I want from it and display it's contents on a treeview.
So far I can only show the folders themselves on the treeview with the following code:
I've added the following code, inside the for cycle, in order to try to add the subitems to selected folders:
So the whole code would be something like this:
Although, I only keep getting the folders on the treeview and not the subitems of each folder, something like this:
![Name: File Store.png
Views: 26
Size: 66.5 KB]()
As the title states I'm trying to display in a treeview the subitems of a folder from listview.
The listview works somewhat like an explorer and I just pick the folders I want from it and display it's contents on a treeview.
So far I can only show the folders themselves on the treeview with the following code:
Code:
tvInventory.Nodes.Add("Items")
For i As Integer = 0 To lvExplorer.SelectedItems.Count - 1
tvInventory.Nodes(0).Nodes.Add(lvExplorer.SelectedItems(i).Name)
Next
Code:
For j As Integer = 1 To lvExplorer.Items(i).SubItems.Count - 1
tvInventory.Nodes(i).Nodes.Add(lvExplorer.Items(j).Name)
Next
Code:
tvInventory.Nodes.Add("Items")
For i As Integer = 0 To lvExplorer.SelectedItems.Count - 1
tvInventory.Nodes(0).Nodes.Add(lvExplorer.SelectedItems(i).Name)
For j As Integer = 1 To lvExplorer.Items(i).SubItems.Count - 1
tvInventory.Nodes(i).Nodes.Add(lvExplorer.Items(j).Name)
Next
Next