P
Patrick.O.Ige
I have this code below.
All its suppose to do is to EXPAND / COLLAPSE ALL of my treeview.
But when i use ASP.NET WEbmatrix it all works fine ..
But with VS.NET is says TreeNodeCollection not defined
and TreeNode not defined!!!!!!!!!!!!!!arg!!!!
How am i suppose to define it in VS.NET..
OR Does anybody another way of doing it!!
Any help appreciated!
Private Sub expandAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to expand the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nodes, True)
End Sub
Private Sub collapseAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to collapse the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nodes, False)
End Sub
'Recursive function.
Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
Dim node As TreeNode
'Loop through each node of the collection and expand it.
For Each node In nodes
node.Expanded = expand
'Call the recursive function from itself, just the subnode
collection (this will ensure all nodes either are collapsed or expanded).
expandCollapseAllTreeviewNodes(node.Nodes, expand)
Next
End Sub
ASP.NET
All its suppose to do is to EXPAND / COLLAPSE ALL of my treeview.
But when i use ASP.NET WEbmatrix it all works fine ..
But with VS.NET is says TreeNodeCollection not defined
and TreeNode not defined!!!!!!!!!!!!!!arg!!!!
How am i suppose to define it in VS.NET..
OR Does anybody another way of doing it!!
Any help appreciated!
Private Sub expandAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to expand the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nodes, True)
End Sub
Private Sub collapseAll(ByVal sender As Object, ByVal e As EventArgs)
'Call the recursive function with the rootnode collection and a
boolean value indication to collapse the nodes.
expandCollapseAllTreeviewNodes(Me.tvFamilyTree.Nodes, False)
End Sub
'Recursive function.
Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
Dim node As TreeNode
'Loop through each node of the collection and expand it.
For Each node In nodes
node.Expanded = expand
'Call the recursive function from itself, just the subnode
collection (this will ensure all nodes either are collapsed or expanded).
expandCollapseAllTreeviewNodes(node.Nodes, expand)
Next
End Sub
ASP.NET