Groups | Blog | Home
all groups > asp.net webcontrols > october 2005 >

asp.net webcontrols : TreeView Webcontrol dynamic adding nodes problems


lourivas
10/28/2005 12:11:32 PM
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=B4s
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 _
=3D TreeView1.Nodes(0).Nodes(0)

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

Tks,
Lourival
Annie
11/1/2005 12:00:00 AM
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?



[quoted text, click to view]
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

AddThis Social Bookmark Button