- Online Barcode Generator
- How To
- Buy Now
Adding/Removing Nodes of KetticTreeView in C#.NET
The nodes commands of KetticTreeView are placed in the button bar on the left panel of the property builder. These node commands allow us to add, remove, and arrange the nodes of the tree view structure. For example, we can easily add a new root node or a child node, as well as remove the selected node. At the same time, we can make the chosen child node a sibling of its parent and make the chosen node a child of the previous node in the list. Furthermore, we are able to move the selected node up and down in the list. The following C# tutorial demonstrates how to manipulate the nodes at run time.
C# Add Nodes to KetticTreeView control
The nodes of KetticTreeView are in a hierarchical structure. The KetticTreeView includes the Nodes.Add() method for the developers to create a node to the KetticTreeView. When we need to create a descendant of the node, we can use the parent nodes Nodes.Add() method. The following C# code snippet demonstrates how to add nodes to KetticTreeView.
If we need to cancel the node adding before it is added, we can use the NodeAdding event, which is fired before adding a node. When we shall cancel the added node, we can use the NodeAdded event, which is fired when the node is added successfully. The following C# code sample shows how to using the events.
C# Remove Nodes to KetticTreeView control
KetticTreeView contains the Remove() method to delete an individual node and the Nodes.Clear() method to delete the entire nodes at once. The C# code snippet below show how to use the two methods
If we need to cancel the node removing before it is deleted, we can use the NodeRemoving event, which is fired before removing a node. When we shall cancel the removed node, we can use the NodeRemoved event, which is fired when the node is removed successfully. The following C# code sample shows how to using the events.
UI Controlsfor Windows Forms.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls