# ASP.NET MVC DropDownTree Overview

The Telerik UI DropDownTree HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI DropDownTree widget.

The DropDownTree represents an editor of hierarchical data, rendered in a tree-like structure, which provides multiple selection option and custom nodes.

* [Demo page for the DropDownTree HtmlHelper](https://demos.telerik.com/aspnet-mvc/dropdowntree/index)

## Initializing the DropDownTree

The following example demonstrates how to define the DropDownTree.

```Razor HtmlHelper
@(Html.Kendo().DropDownTree()
    .Name("dropdowntree")
    .DataTextField("Name")
    .DataValueField("id")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("Read_DropDownTreeData", "Home")
        )
    )
)
```

```C# Controller
public static IList<HierarchicalViewModel> GetHierarchicalData()
{
    var result = new List<HierarchicalViewModel>()
    {
        new HierarchicalViewModel() { ID = 1, ParentID = null, HasChildren = true, Name = "Parent item" },
        new HierarchicalViewModel() { ID = 2, ParentID = 1, HasChildren = true, Name = "Parent item" },
        new HierarchicalViewModel() { ID = 3, ParentID = 1, HasChildren = false, Name = "Item" },
        new HierarchicalViewModel() { ID = 4, ParentID = 2, HasChildren = false, Name = "Item" },
        new HierarchicalViewModel() { ID = 5, ParentID = 2, HasChildren = false, Name = "Item" }
    };

    return result;
}

public ActionResult Read_DropDownTreeData(int? id)
{
    var result = GetHierarchicalData()
        .Where(x => id.HasValue ? x.ParentID == id : x.ParentID == null)
        .Select(item => new {
            id = item.ID,
            Name = item.Name,
            hasChildren = item.HasChildren
        });

    return Json(result, JsonRequestBehavior.AllowGet);
}
```

## Basic Configuration

The following example demonstrates the basic configuration of the DropDownTree.

```Razor HtmlHelper
    @(Html.Kendo().DropDownTree()
        .Name("dropdowntree")
        .Checkboxes(true)
        .Filter(FilterType.Contains)
        .DataTextField("Name")
        .DataTextField("ID")
        .DataSource(dataSource => dataSource
            .Read(read => read
                .Action("Employees", "Home")
            )
        )
    )
```

## Functionality and Features

| Feature                                                                                                                     | Description                                                                                                          |
| --------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| [Data binding](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/binding/binding-overview) | The DropDownTree supports different data binding approaches.                                                         |
| [Checkboxes](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/checkboxes)                 | You can add checkboxes to the DropDownTree's items.                                                                  |
| [Filtering](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/filtering)                   | You are able to filter the displayed DropDownTree items by their text value.                                         |
| [Items](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/items)                           | You can configure different options for the items of the component.                                                  |
| [Templates](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/templates)                   | The DropDownTree supports customizing its look through templates.                                                    |
| [Accessibility](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/accessibility/overview)  | The DropDownTree is accessible by screen readers and provides WAI-ARIA, Section 508, WCAG 2.2, and keyboard support. |

## Next Steps

* [Getting Started with the DropDownTree](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/editors/dropdowntree/getting-started)
* [Basic Usage of the DropDownTree HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/dropdowntree/index)

## See Also

* [Using the API of the DropDownTree HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/dropdowntree/api)
* [Knowledge Base Section](https://www.telerik.com/aspnet-mvc/documentation/knowledge-base)
