TreeView Webcontrol dynamic adding nodes problems

L

lourivas

Hi,
i'm using Treeview IE webcontrol and trying to add nodes dynamically
when a user clicks on a button. The problem occurs when a user clicks
on a second time on that button to add a second child node. It´s
overrding the fist one.

Below is a code that run each time a user clicks on that button. What
is wrong?

Private Sub ImageButton1_Click(.......

Dim vNode0 As New Microsoft.Web.UI.WebControls.TreeNode
Dim vNodeAtual As Microsoft.Web.UI.WebControls.TreeNode _
= TreeView1.Nodes(0).Nodes(0)

vNode0.Text = DropDownList1.SelectedValue
vNodeAtual.Expanded = True
vNodeAtual.Nodes.Add(vNode0)
end sub

Tks,
Lourival
 
A

Annie

Do we really have such a control in ASP.net? or it is a custom control by
others?
I haven't seen such thing in visual studio 2003?
I could be wrong?



Hi,
i'm using Treeview IE webcontrol and trying to add nodes dynamically
when a user clicks on a button. The problem occurs when a user clicks
on a second time on that button to add a second child node. It´s
overrding the fist one.

Below is a code that run each time a user clicks on that button. What
is wrong?

Private Sub ImageButton1_Click(.......

Dim vNode0 As New Microsoft.Web.UI.WebControls.TreeNode
Dim vNodeAtual As Microsoft.Web.UI.WebControls.TreeNode _
= TreeView1.Nodes(0).Nodes(0)

vNode0.Text = DropDownList1.SelectedValue
vNodeAtual.Expanded = True
vNodeAtual.Nodes.Add(vNode0)
end sub

Tks,
Lourival
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top