# Remove Nodes

Learn how to remove nodes in ComponentOne Treeview.

## Content

The [C1TreeNodeCollection](/componentone/docs/win/online-treeview/) class provides the [Remove](/componentone/docs/win/online-treeview/) method and the [RemoveAt](/componentone/docs/win/online-treeview/) method for removing nodes from TreeView. You can use either of the two methods with the [Nodes](/componentone/docs/win/online-treeview/) collection of [C1TreeView](/componentone/docs/win/online-treeview/) to remove parent nodes from TreeView. To remove a child node from a parent node or children nodes from a child node, you can use either of the two methods with the [Nodes](/componentone/docs/win/online-treeview/) collection of [C1TreeNode](/componentone/docs/win/online-treeview/).

The [Remove](/componentone/docs/win/online-treeview/) method and the [RemoveAt](/componentone/docs/win/online-treeview/) method removes a single node at a time. However, to remove all nodes simultaneously from the Nodes collection of TreeView, a parent node, or a child node, you can use the [Clear](/componentone/docs/win/online-treeview/) method with the Nodes collection of C1TreeView or C1TreeNode, respectively.

Here is the code snippet demonstrating how to set these methods.

```vbnet
' remove the second parent node from the TreeView Nodes collection
C1TreeView1.Nodes.Remove(parentNode2)
' remove the node at index 1
C1TreeView1.Nodes.RemoveAt(1)
```

```csharp
// remove the second parent node from the TreeView Nodes collection
c1TreeView1.Nodes.Remove(parentNode2);
// remove the node at index 1
c1TreeView1.Nodes.RemoveAt(1);
```

After removing the nodes, the treeview appears like the following.

![TreeView after removing nodes](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/addingandremovingnodes3.png)