The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I just found an example on how to inherit from TreeView to allow selection of multiple nodes. Everything works fine. Now I want to delete the selected nodes. Here's what I tried:
for each DummyNode in TreDokumente.SelectedNodes
TreDokumente.Nodes.Remove (DummyNode)
next
but that doesn't work. Any ideas how to do it?
ADAdministrator Syncfusion Team October 23, 2002 11:49 PM UTC
> I just found an example on how to inherit from TreeView to allow selection of multiple nodes. Everything works fine. Now I want to delete the selected nodes. Here's what I tried:
>
> for each DummyNode in TreDokumente.SelectedNodes
> TreDokumente.Nodes.Remove (DummyNode)
> next
>
> but that doesn't work. Any ideas how to do it?
Hi,
The Nodes collection is not a single level one. Each node can then have its own collection like a true true. So, it must be that your selected nodes are not in the Nodes collection that you are trying to delete them from.
You should do something like this.
node.Parent.Nodes.Remove(node);
Hope this helps.
Daniel
Syncfusion