sorry about that I had used the conversion (C# to VB) tool from here http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
Just replace the older one with
Protected Sub TreeView1_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodeExpanded
If e.Node.Parent Is Nothing Then
For Each node As TreeNode In (CType(sender, TreeView)).Nodes
If Not (node.Equals(e.Node)) Then
node.Collapse()
End If
Next
Return
End If
Dim tn As TreeNode = e.Node.Parent
For Each node As TreeNode In tn.ChildNodes
If Not (node.Equals(e.Node)) Then
node.Collapse()
End If
Next
If (e.Node.Depth = 1) Then
End If
End Sub
Regarding the new layout. Can you explain a little more of what you are trying to do?
ubaid1900
Participant
918 Points
187 Posts
Re: TreeView Collapse and Expand Dynamically
Nov 28, 2006 01:22 AM|LINK
sorry about that I had used the conversion (C# to VB) tool from here http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx
Just replace the older one with
Protected Sub TreeView1_TreeNodeExpanded(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.TreeNodeEventArgs) Handles TreeView1.TreeNodeExpanded
If e.Node.Parent Is Nothing Then
For Each node As TreeNode In (CType(sender, TreeView)).Nodes
If Not (node.Equals(e.Node)) Then
node.Collapse()
End If
Next
Return
End If
Dim tn As TreeNode = e.Node.Parent
For Each node As TreeNode In tn.ChildNodes
If Not (node.Equals(e.Node)) Then
node.Collapse()
End If
Next
If (e.Node.Depth = 1) Then
End If
End Sub
Regarding the new layout. Can you explain a little more of what you are trying to do?
Thanks