Welcome Guest Search | Active Topics | Sign In | Register

Inserting new node into parent/child treeview using VB Options
Glenn Dardick
Posted: Saturday, November 13, 2010 10:09:34 AM
Rank: Newbie
Groups: Member

Joined: 11/11/2010
Posts: 8
How do I insert a new node into parent/child treeview node using VB after selecting an existing node within the treeview control?

I can select a node in a treeview and can access the information for the selected node via VB onclick code behind an asp button. The following works:

MsgBox("inserting after " & TreeView1.SelectedNode.Text & "(" & TreeView1.SelectedNode.Value & ")")

What I am having trouble doing is inserting a new node within the node selected.

I do have access to the existing "TreeView1_ItemMoved" code from the "drag and drop reordering" demo - which does work.
eo_support
Posted: Saturday, November 13, 2010 10:38:28 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You would do something like this:

Code: Visual Basic.NET
Dim childNode as EO.Web.TreeNode  = New EO.Web.TreeNode("child node")

parentNode.ChildNodes.Add(childNode)


Thanks
Glenn Dardick
Posted: Saturday, November 13, 2010 3:31:13 PM
Rank: Newbie
Groups: Member

Joined: 11/11/2010
Posts: 8
Thanks! That got me on the right track.
eo_support
Posted: Sunday, November 14, 2010 7:26:46 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Great. Glad that we were able to help.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.