# Select Nodes

You can select nodes in Treeview in different manners. This topic discusses about the classes, methods and properties used in selecting nodes.

## Content

To select TreeView nodes in different ways, you need to set the [SelectionMode](/componentone/docs/win/online-treeview/) property of [C1TreeView](/componentone/docs/win/online-treeview/). The SelectionMode property accepts the following values from the [C1TreeViewSelectionMode](/componentone/docs/win/online-treeview/) enumeration:

* **Multi**: Allows you to select multiple nodes (parent or child) in TreeView. You can select multiple nodes either in a contiguous or a non-contiguous manner. To select multiple nodes in a contiguous manner, hold the SHIFT key while clicking on nodes. And to select nodes in a non-contiguous manner, hold the CTRL key while clicking on nodes.
* **MultiSibling**: Allows you to select multiple nodes in a contiguous or a non-contiguous manner using SHIFT or CTRL keys respectively, within a parent node only.
* **None**: Does not allow you to select any node in TreeView.
* **Single (default value)**: Allows you to select only one node (parent or child) in TreeView at a time.

Below is the sample code snippet setting the [SelectionMode](/componentone/docs/win/online-treeview/) property.

```vbnet
' set the SelectionMode property to Multi
C1TreeView1.SelectionMode = C1.Win.TreeView.C1TreeViewSelectionMode.Multi
```

```csharp
// set the SelectionMode property to Multi
c1TreeView1.SelectionMode = C1.Win.TreeView.C1TreeViewSelectionMode.Multi;
```

### Contiguous Selection

![Contiguous Selection](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/selectingnodes1.png)

### Non-contiguous Selection

**![Non-contiguous Selection](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/selectingnodes2.png)**

You can also select a node by setting the [Selected](/componentone/docs/win/online-treeview/) property of [C1TreeNode](/componentone/docs/win/online-treeview/) to **True**.

>type=note
> The **Selected** property of **C1TreeNode** is not applicable when the **SelectedMode** property of **C1Treeview** is set to **None**.

The following code snippet demonstrates how to set the property.

```vbnet
' enable the Selected property for the first parent node
C1TreeView1.Nodes(0).Selected = True
```

```csharp
// enable the Selected property for the first parent node
c1TreeView1.Nodes[0].Selected = true;
```

The node for which the property is set gets selected as shown below.

![Selected node](https://cdn.mescius.io/document-site-files/images/56bb69d1-e225-4d79-8965-f70a0e789043/images/selectingnodes3.png)

Furthermore, you can also select a node at runtime by right-clicking it. This is the default behavior of TreeView. However, you can change this behavior by setting [RightClickSelect](/componentone/docs/win/online-treeview/) property of the **C1TreeView** class as **false**.