L
Luis E Valencia
How to Collapse all the nodes of a tree view?
Private Sub TreeView1_Expand(ByVal sender As Object, ByVal e As
Microsoft.Web.UI.WebControls.TreeViewClickEventArgs) Handles
TreeView1.Expand
Dim nodo As TreeNode
Dim nodoactual As TreeNode
Response.Write("HOLA")
nodoactual = CType(sender, TreeNode)
For Each nodo In TreeView1.Nodes
If Not nodo.Equals(nodoactual) Then
nodo.Expanded = False
End If
Next
End Sub
It didnt work.
I have many root nodes, If I open one and then open another root node the
last one must close
Private Sub TreeView1_Expand(ByVal sender As Object, ByVal e As
Microsoft.Web.UI.WebControls.TreeViewClickEventArgs) Handles
TreeView1.Expand
Dim nodo As TreeNode
Dim nodoactual As TreeNode
Response.Write("HOLA")
nodoactual = CType(sender, TreeNode)
For Each nodo In TreeView1.Nodes
If Not nodo.Equals(nodoactual) Then
nodo.Expanded = False
End If
Next
End Sub
It didnt work.
I have many root nodes, If I open one and then open another root node the
last one must close