# Getting Started with WinForms TreeView

This tutorial will help you to quickly get started using the control.

## Adding Telerik Assemblies Using NuGet

To use `RadTreeView` when working with NuGet packages, install the `Telerik.UI.for.WinForms.AllControls` package. The [package target framework version may vary](https://www.telerik.com/products/winforms/documentation/visual-studio-integration/available-nugets).

Read more about NuGet installation in the [Install using NuGet Packages](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/install-using-nuget) article.

> tip With the 2025 Q1 release, the Telerik UI for WinForms has a new licensing mechanism. You can learn more about it [here](https://www.telerik.com/products/winforms/documentation/licensing/license-key).

## Adding Assembly References Manually

When dragging and dropping a control from the Visual Studio (VS) Toolbox onto the Form Designer, VS automatically adds the necessary assemblies. However, if you're adding the control programmatically, you'll need to manually reference the following assemblies:

* **Telerik.Licensing.Runtime**
* **Telerik.WinControls**
* **Telerik.WinControls.UI**
* **TelerikCommon**

The Telerik UI for WinForms assemblies can be install by using one of the available [installation approaches](https://www.telerik.com/products/winforms/documentation/installation-and-upgrades/installing-on-your-computer).

## Defining the RadTreeView

The following tutorial will help you get started working with the **RadTreeView** at design time and programmatically. Topics included are: 

* Associating breadcrumb component to the **RadTreeView.**

* Using the **RadTreeView** designer to add and configure nodes.

* Programmatically adding and configuring nodes.

##  Getting Started Tutorial

1. Create a new Windows Forms Application.

2. On the form add a **RadBreadCrumb** and **RadTreeView**.

3. In the `Properties` window  for the **RadBreadCrumb** set the **DefaultTreeView** property to point to the **RadTreeView**. The design should now look like this.

   ![WinForms RadTreeView Properties](https://www.telerik.com/products/winforms/documentation/assets/4eb7f6a982f7a2bacb7daa2c751db195/treeview-getting-started001.png)

4. Drop the **TelerikMetro** theme form the tool box and set all controls **ThemeName** property to **TelerikMetro**.

5. Right click the **RadTreeView** and select **Open Property Builder** from the context menu. You will see a set of buttons on the left side of the **RadTreeView** Property Builder and a preview of the tree view below the buttons. See [Property Builder](https://www.telerik.com/products/winforms/documentation/controls/treeview/design-time/property-builder) topic for a complete tour of functionality.

6. Click the far left button (a green "Plus" button that adds nodes) three times to add three nodes.

7. Click the first node and enter "Email Contacts" in the Text entry.

8. Click the second node and enter "Lists" in the **Text** entry.

9. Click the third node and enter "Reports" in the **Text** entry.

10. Click the RadTreeView Properties tab located in the left part of the Window.

11. Check **Show Lines**.

12. Click OK to close the Property Builder.The design should now look like the screenshot below.

    ![WinForms RadTreeView PropertyBuilder](https://www.telerik.com/products/winforms/documentation/assets/5ea797ef3b4700833cfe31d233fe7116/treeview-getting-started002.png)

13. In the form code add a "using" statement for Telerik.WinControls.UI

14. In the form's constructor add the code appearing below the **InitializeComponent()** method call. This code creates new **RadTreeNode** objects, populates them with text and attaches them to parent nodes.

```C#
RadTreeNode node = radTreeView1.Nodes["Email Contacts"].Nodes.Add("Bob Tony");
node.Selected = true;

radTreeView1.Nodes["Email Contacts"].Nodes.Add("Sue Winchell");
radTreeView1.Nodes["Email Contacts"].Nodes.Add("Lui Sang");
radTreeView1.Nodes["Lists"].Nodes.Add("Priorities");
radTreeView1.Nodes["Lists"].Nodes.Add("Opportunities");
radTreeView1.Nodes["Lists"].Nodes.Add("Issues");

node = radTreeView1.Nodes["Reports"].Nodes.Add("June Sales");
node = radTreeView1.Nodes["Reports"].Nodes.Add("July Sales");
node = radTreeView1.Nodes["Reports"].Nodes.Add("First Quarter Summary");
node = radTreeView1.Nodes["Reports"].Nodes.Add("Second Quarter Summary");

```

```VB.NET
Dim node As RadTreeNode = RadTreeView1.Nodes("Email Contacts").Nodes.Add("Bob Tony")
node.Selected = True

RadTreeView1.Nodes("Email Contacts").Nodes.Add("Sue Winchell")
RadTreeView1.Nodes("Email Contacts").Nodes.Add("Lui Sang")
RadTreeView1.Nodes("Lists").Nodes.Add("Priorities")
RadTreeView1.Nodes("Lists").Nodes.Add("Opportunities")
RadTreeView1.Nodes("Lists").Nodes.Add("Issues")

node = RadTreeView1.Nodes("Reports").Nodes.Add("June Sales")
node = RadTreeView1.Nodes("Reports").Nodes.Add("July Sales")
node = RadTreeView1.Nodes("Reports").Nodes.Add("First Quarter Summary")
node = RadTreeView1.Nodes("Reports").Nodes.Add("Second Quarter Summary")

```

14\. Run the application.

![WinForms RadTreeView Getting Started Run](https://www.telerik.com/products/winforms/documentation/assets/4fa15603b302f0baf60a3d78556f3f35/treeview-getting-started003.png)

## See Also

* [Breadcrumb](https://www.telerik.com/products/winforms/documentation/controls/treeview/breadcrumb)

* [Properties, Methods and Events](https://www.telerik.com/products/winforms/documentation/controls/treeview/properties-methods-events)

* [Structure](https://www.telerik.com/products/winforms/documentation/controls/treeview/structure)

## Telerik UI for WinForms Learning Resources

* [Telerik UI for WinForms TreeView Component](https://www.telerik.com/products/winforms/treeview.aspx)
* [Getting Started with Telerik UI for WinForms Components](https://docs.telerik.com/devtools/winforms/getting-started/first-steps)
* [Telerik UI for WinForms Setup](https://docs.telerik.com/devtools/winforms/installation-and-upgrades/installing-on-your-computer)
* [Telerik UI for WinForms Converter](https://www.telerik.com/products/winforms/documentation/ai-coding-assistant/converter/converter)
* [Telerik UI for WinForms Visual Studio Templates](https://docs.telerik.com/devtools/winforms/visual-studio-integration/visual-studio-templates)
* [Deploy Telerik UI for WinForms Applications](https://docs.telerik.com/devtools/winforms/deployment-and-distribution/application-deployment)
* [Telerik UI for WinForms Virtual Classroom(Training Courses for Registered Users)](https://learn.telerik.com/learn/course/external/view/elearning/17/telerik-ui-for-winforms)
* [Telerik UI for WinForms License Agreement)](https://www.telerik.com/purchase/license-agreement/winforms-dlw-s)
