Tree Grid not only allows you to present the data in a structured form but it also supports performing various operations with the nodes. You can add, delete, move and fetch nodes by using various methods provided by the Node class.
You can add a node at a specific position in the Tree Grid using AddNode method of the Node class. This appends a new node row to the collection. The method takes NodeTypeEnum enumeration as its argument which lets you specify a node with respect to another given node.
The code below shows how to add a node in the WinForms Tree Grid at a specific location.
You can delete a selected node from the Tree Grid using RemoveNode method of the Node class.
Following code demonstrates how to delete a node from the WinForms Tree Grid.
The Tree Grid allows you to move the node rows to a new position using Move method of the Node class. The method takes NodeMoveEnum enumeration as an argument which lets you specify the direction in which node has to be moved.
Use the code below to move a node of the WinForms Tree Grid to a new position.
In Tree Grid, you can select the nodes to perform different operations using GetNode method of the Node class. The method takes a parameter called NodeTypeEnum enumeration which specifies a node with respect to another given node.
The code below specifies how to fetch a specific node of the WinForms Tree Grid and show it in selected state.
You can expand and collapse all nodes in your Tree Grid application using the Collapsed property of Node class as shown in the code below. This feature makes it convenient to navigate through node headers as a group when required.
Following code shows how to expand and collapse nodes of the WinForms Tree Grid.
In Tree Grid, you can drag and drop a selected node to a specific position by handling the MouseUp, MouseDown and MouseMove events.
The code below lets the user drag and drop nodes of the WinForms Tree Grid.