[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Expand nodes through server side code?

(Greg)

12/25/2002 10:27:00 PM

Hi,

I'm using the TreeNodeSrc property of tree nodes that allows a node to
point to a URL for its children. This helps speed considerably...

My problem is that I also want to allow the user to click a button to
expand all nodes beneath the selected node. I was hopeing that
setting the .Expanded property of a node to True would cause the same
action as when the user clicks the + sign - causing the children to
populate.

Can anyone suggest how to do this?

Sample code I tried:

Private Sub ExpandAllNodesFromSelected(ByVal objSelectedNode As
Microsoft.Web.UI.WebControls.TreeNode)
Dim oNode As Microsoft.Web.UI.WebControls.TreeNode

objSelectedNode.Expanded = True 'DOES NOT FIRE fetch of children.

For Each oNode In objSelectedNode.Nodes
oNode.Expanded = True

ExpandAllNodesFromSelected(oNode)
Next
End Sub

Thanks,

Greg