How to Collapse all the nodes of a tree view?

  • Thread starter Luis E Valencia
  • Start date

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
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top