Data Binding

The DropDownTree HTML helper provides support for declaratively defining its items and for local (on the server) and remote (using a DataSource configuration object) binding.

Declaring DropDownTree Items

The DropDownTree allows you to declare all of its items within the HTML helper declaration.

The following example demonstrates how to configure a DropDownTree with three levels of hierarchy.

@(Html.Kendo().DropDownTree()
    .Name("dropdowntree")
    .Items(dropdowntree =>
    {
        dropdowntree.Add().Text("My Documents")
            .Expanded(true)
            .Items(root =>
            {
                root.Add().Text("Kendo UI Project")
                    .Expanded(true)
                    .Items(project =>
                    {
                        project.Add().Text("about.html");
                        project.Add().Text("index.html");
                        project.Add().Text("logo.png");
                    });

                root.Add().Text("New Web Site");
                root.Add().Text("Reports");
            });
    })
)

The DropDownTree supports the following data-binding approaches:

See Also

In this article
Not finding the help you need? Improve this article