G
Guest
Hello All,
I having a small problem. I wrote a procedure to add nodes
to my IE Treeview control and all nodes are added. Now,
the problem is that all the nodes are added in the Root
node. Some of the nodes should be added as a child node.
Here is my procedure, Can someone troubleshoot this code
please:
Dim strDirectories As String()
Dim strDirectory As String
Dim strFile As String
Dim nodDirectory As TreeNode
Dim nodFile As TreeNode
strDirectories = Directory.GetDirectories(Server.MapPath
("PDF"))
For Each strDirectory In strDirectories
nodDirectory = New TreeNode
nodDirectory.Text = strDirectory.Substring
(strDirectory.LastIndexOf("\") + 1)
Me.tvMenu.Nodes.Add(nodDirectory)
For Each strFile In Directory.GetFiles
(strDirectory)
nodFile = New TreeNode
nodFile.Text = strFile.Substring
(strFile.LastIndexOf("\") + 1)
Me.tvMenu.Nodes.AddAt(strDirectory,
nodFile)
Next
Next
I having a small problem. I wrote a procedure to add nodes
to my IE Treeview control and all nodes are added. Now,
the problem is that all the nodes are added in the Root
node. Some of the nodes should be added as a child node.
Here is my procedure, Can someone troubleshoot this code
please:
Dim strDirectories As String()
Dim strDirectory As String
Dim strFile As String
Dim nodDirectory As TreeNode
Dim nodFile As TreeNode
strDirectories = Directory.GetDirectories(Server.MapPath
("PDF"))
For Each strDirectory In strDirectories
nodDirectory = New TreeNode
nodDirectory.Text = strDirectory.Substring
(strDirectory.LastIndexOf("\") + 1)
Me.tvMenu.Nodes.Add(nodDirectory)
For Each strFile In Directory.GetFiles
(strDirectory)
nodFile = New TreeNode
nodFile.Text = strFile.Substring
(strFile.LastIndexOf("\") + 1)
Me.tvMenu.Nodes.AddAt(strDirectory,
nodFile)
Next
Next