|
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.
|
|
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
|
|
Rank: Newbie Groups: Member
Joined: 11/11/2010 Posts: 8
|
Thanks! That got me on the right track.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Great. Glad that we were able to help.
Thanks
|
|