remove selected treenode

Hi,

I would like to delete a selected treenode and all treennodes below the
selected one...
I've tried ...

Me.Treeview1.Nodes.Remove(Treeview1.SelectedNode)

but nothing is removed....



Does anyone have an idea ?

Thanx

John
John Devlon [ Mo, 21 April 2008 14:49 ] [ ID #1946593 ]

Re: remove selected treenode

If you are referring to the treenode from webcontrols, then you need
to obtain the treenodescollection for the treeview and invoke its
remove method on the indexed child node:

Treeview1.Childnodes(index).remove
Andy [ Mo, 21 April 2008 19:13 ] [ ID #1946641 ]

Re: remove selected treenode

Thanx Andy

John



"Andy" <anedza [at] infotek-consulting.com> schreef in bericht
news:2178c8ee-cf61-42c8-bdec-de64209727df [at] p25g2000pri.google groups.com...
> If you are referring to the treenode from webcontrols, then you need
> to obtain the treenodescollection for the treeview and invoke its
> remove method on the indexed child node:
>
> Treeview1.Childnodes(index).remove
John Devlon [ Mo, 21 April 2008 20:38 ] [ ID #1946664 ]
Microsoft » microsoft.public.dotnet.framework.aspnet » remove selected treenode

Vorheriges Thema: databinding checkBoxList to a Dictionary<string, string> object
Nächstes Thema: HTTPWebRequest - IO.Streamwriter and Mysterious Line Feed