# Events

**RadTreeView** provides a large set of events which allows you to respond to node interactions.

* **NodeAdded/NodeAdding**: The events occur before and after node is added.

* **NodeRemoved/NodeRemoving**: The events occur before and after node is removed.

* **NodeExpandedChanged/NodeExpandedChanging**: The events occur before and after node is expanded or collapsed.

* **NodeMouseClick/NodeMouseDoubleClick**: The events occur when a node is clicked or double clicked.

> note Since **R3 2020** the **NodeMouseClick/NodeMouseDoubleClick**  events offer one additional parameter which allows access to the original MouseEventArgs. It is necessary to cast the event arguments to **RadTreeViewMouseEventArgs**.

* **SelectedNodeChanging**: The event occurs before a tree node is selected.

* **SelectedNodeChanged**: The event occurs after the tree node is selected.

> note Note that **SelectedNodeChanged** event fires twice. For more information, you can see the [Selecting Nodes](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/selecting-nodes) article.

* **SelectedNodesChanged** - the event occurs when SelectedNodes collection has been changed.

```C#
private void RadTreeView1_NodeMouseClick(object sender, RadTreeViewEventArgs e)
{
    RadTreeViewMouseEventArgs args = e as RadTreeViewMouseEventArgs;
    if (args.OriginalEventArgs.Button == MouseButtons.Right)
    {
        //TO DO
    }
}
```

```VB.NET
Private Sub RadTreeView1_NodeMouseClick(ByVal sender As Object, ByVal e As RadTreeViewEventArgs)
    Dim args As RadTreeViewMouseEventArgs = TryCast(e, RadTreeViewMouseEventArgs)

    If args.OriginalEventArgs.Button = MouseButtons.Right Then
        ' TO DO
    End If
End Sub
```

The above events are using **RadTreeViewEventArgs** and **RadTreeViewCancelEventArgs** objects to provide you with useful information inside the events. The main difference is that you can cancel the interaction in the second case. These objects are exposing the following information:

| Parameter       | Description                                                                                      |
| --------------- | ------------------------------------------------------------------------------------------------ |
| **Action**      | Indicates how the node was changed. Can have the following values: ByKeyboard; ByMouse; Unknown. |
| **Node**        | The node that has been changed.                                                                  |
| **TreeElement** | Gives the main TreeView element the node belongs to.                                             |
| **TreeView**    | Returns the TreeView control that holds the current node.                                        |
| **Cancel**      | Allows you to cancel the change.(Only available in the RadTreeViewCancelEventArgs object)        |

## See Also

* [Adding and Removing Nodes](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/adding-and-removing-nodes)

* [Bring a Node into View](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/bring-a-node-into-view)

* [Custom Filtering](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/custom-filtering)

* [Custom Nodes](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/custom-nodes)

* [Custom Sorting](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/custom-sorting)

* [Filtering Nodes](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/filtering-nodes)

* [Selecting Nodes](https://www.telerik.com/products/winforms/documentation/controls/treeview/working-with-nodes/selecting-nodes)
