Kendo.Mvc.UI.Fluent.DropDownTreeBuilder

Defines the fluent interface for configuring the DropDownTree component.

Methods

AutoBind(System.Boolean)

Controls whether to bind the widget to the DataSource on initialization.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .AutoBind(false)
%>

AutoClose(System.Boolean)

Controls whether to close the popup when item is selected or checked.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .AutoClose(true)
%>

AutoWidth(System.Boolean)

If set to true, the widget automatically adjusts the width of the popup element and does not wrap up the item label.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .AutoWidth(true)
%>

CheckAll(System.Boolean)

When this options is set to true and checkboxes are enabled, a tristate checkbox appears above the embedded treeview. Clicking that checkbox will check or uncheck all the loaded enabled items of the treeview.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .CheckAll(true)
    .Checkboxes(true)
%>

CheckAllTemplate(System.String)

The template used to render the checkAll label. By default, the widget displays only a span element with text "Check all".

Parameters

value System.String

The value for CheckAllTemplate

CheckAllTemplateId(System.String)

The template used to render the checkAll label. By default, the widget displays only a span element with text "Check all".

Parameters

templateId System.String

The ID of the template element for CheckAllTemplate

Template(System.String)

Template to be used for rendering the items in the dropdowntree.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Template("#= data #")
%>

TemplateId(System.String)

Id of the template element to be used for rendering the items in the dropdowntree.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .TemplateId("widgetTemplateId")
%>

Checkboxes(System.Boolean)

Enable/disable rendering of checkboxes in the dropdowntree.

Parameters

enabled System.Boolean

Whether checkboxes should be rendered.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Checkboxes(true)
%>

Checkboxes(System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeCheckboxesBuilder>)

Configures rendering of checkboxes in the dropdowntree.

Parameters

configure System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeCheckboxesBuilder>

Builder of the dropdowntree checkboxes configuration.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Checkboxes(config => config
        .CheckChildren(true)
    )
%>

ClearButton(System.Boolean)

Unless this option is set to false, a button will appear when hovering the widget. Clicking that button will reset the widget's value and will trigger the change event.

Parameters

value System.Boolean

The value for ClearButton

Items(System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeItemFactory>)

Defines the items in the DropDownTree

Parameters

addAction System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeItemFactory>

The add action.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Items(items =>
    {
        items.Add().Text("First Item");
        items.Add().Text("Second Item");
    })
%>

Events(System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeEventBuilder>)

Configures the client-side events.

Parameters

clientEventsAction System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeEventBuilder>

The client events action.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Events(events =>
        .OnDataBinding("onDataBinding")
        .OnItemDataBound("onItemDataBound")
    )
%>

BindTo(System.String,System.Action<Kendo.Mvc.UI.DropDownTreeItem,Kendo.Mvc.SiteMapNode>)

Binds the DropDownTree to a sitemap

Parameters

viewDataKey System.String

The view data key.

siteMapAction System.Action<Kendo.Mvc.UI.DropDownTreeItem,Kendo.Mvc.SiteMapNode>

The action to configure the item.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .BindTo("examples", (item, siteMapNode) =>
    {
    })
%>

BindTo(System.String)

Binds the DropDownTree to a sitemap.

Parameters

viewDataKey System.String

The view data key.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .BindTo("examples")
%>

BindTo(System.Collections.Generic.IEnumerable<Kendo.Mvc.UI.DropDownTreeItemModel>)

Binds the DropDownTree to a list of items. Use if a hierarchy of items is being sent from the controller; to bind the DropDownTree declaratively, use the Items() method.

Parameters

items System.Collections.Generic.IEnumerable<Kendo.Mvc.UI.DropDownTreeItemModel>

The list of items

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .BindTo(model)
%>

BindTo(System.Collections.Generic.IEnumerable<T1>,System.Action<Kendo.Mvc.UI.DropDownTreeItem,T1>)

Binds the DropDownTree to a list of objects. The DropDownTree will be "flat" which means a DropDownTree item will be created for every item in the data source.

Parameters

dataSource System.Collections.Generic.IEnumerable<T1>

The data source.

itemDataBound System.Action<Kendo.Mvc.UI.DropDownTreeItem,T1>

The action executed for every data bound item.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .BindTo(new []{"First", "Second"}, (item, value) =>
    {
        item.Text = value;
    })
%>

BindTo(System.Collections.IEnumerable,System.Action<Kendo.Mvc.UI.Fluent.NavigationBindingFactory<Kendo.Mvc.UI.DropDownTreeItem>>)

Binds the DropDownTree to a list of objects. The DropDownTree will create a hierarchy of items using the specified mappings.

Parameters

dataSource System.Collections.IEnumerable

The data source.

factoryAction System.Action<Kendo.Mvc.UI.Fluent.NavigationBindingFactory>

The action which will configure the mappings

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .BindTo(Model, mapping => mapping
        .For<Customer>(binding => binding
            .Children(c => c.Orders) // The "child" items will be bound to the the "Orders" property
            .ItemDataBound((item, c) => item.Text = c.ContactName) // Map "Customer" properties to DropDownTreeItem properties
        )
        .For<Order<(binding => binding
            .Children(o => null) // "Orders" do not have child objects so return "null"
            .ItemDataBound((item, o) => item.Text = o.OrderID.ToString()) // Map "Order" properties to DropDownTreeItem properties
        )
    )
%>

Animation(System.Boolean)

Use to enable or disable animation of the DropDownTree.

Parameters

enable System.Boolean

The boolean value.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Animation(false) //toggle effect
%>

Animation(System.Action<Kendo.Mvc.UI.Fluent.PopupAnimationBuilder>)

Configures the animation effects of the widget.

Parameters

animationAction System.Action<Kendo.Mvc.UI.Fluent.PopupAnimationBuilder>

The action which configures the animation effects.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Animation(animation =>
    {
        animation.Open(open =>
        {
            open.SlideIn(SlideDirection.Down);
            });
        })
        %>

DataSource(System.Action<Kendo.Mvc.UI.Fluent.HierarchicalDataSourceBuilder<System.Object>>)

Configure the DataSource of the component

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.HierarchicalDataSourceBuilder>

The action that configures the DataSource.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .DataSource(dataSource => dataSource
        .Read(read => read
            .Action("Employees", "DropDownTree")
        )
    )
%>

LoadOnDemand(System.Boolean)

Allows the dropdowntree to fetch the entire datasource at initialization time.

Parameters

value System.Boolean

Whether the datasource should be loaded on demand.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .LoadOnDemand(false)
%>

DataImageUrlField(System.String)

Sets the field of the data item that provides the image URL of the DropDownTree nodes.

Parameters

value System.String

The value that configures the dataimageurlfield.

DataSpriteCssClassField(System.String)

Sets the field of the data item that provides the sprite CSS class of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value System.String

The value that configures the dataspritecssclassfield.

DataUrlField(System.String)

Sets the field of the data item that provides the link URL of the nodes.

Parameters

value System.String

The value that configures the dataurlfield.

Messages(System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeMessagesSettingsBuilder>)

The text messages displayed in the widget. Use it to customize or localize the messages.

Parameters

configurator System.Action<Kendo.Mvc.UI.Fluent.DropDownTreeMessagesSettingsBuilder>

The action that configures the messages.

DataTextField(System.String)

Sets the field of the data item that provides the text content of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value System.String

The value that configures the datatextfield.

DataTextField(System.String[])

Sets the field of the data item that provides the text content of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value System.String[]

The value that configures the datatextfield.

DataValueField(System.String)

The field of the data item that provides the value of the widget. If an array, each level uses the field that is at the same index in the array, or the last item in the array.

Parameters

value System.String

The value for DataValueField

Delay(System.Int32)

Specifies the delay in milliseconds after which the DropDownTree will start filtering dataSource.

Parameters

value System.Int32

The value for Delay

Enable(System.Boolean)

If set to false the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

Parameters

value System.Boolean

The value for Enable

EnforceMinLength(System.Boolean)

If set to true the widget will not show all items when the text of the search input cleared. By default, the widget shows all items when the text of the search input is cleared. Works in conjunction with minLength.

Parameters

value System.Boolean

The value for EnforceMinLength

FooterTemplate(System.String)

The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.

Parameters

value System.String

The value for FooterTemplate

FooterTemplateId(System.String)

The template used to render the footer template. The footer template receives the widget itself as a part of the data argument. Use the widget fields directly in the template.

Parameters

templateId System.String

The ID of the template element for FooterTemplate

Height(System.String)

The height of the suggestion popup in pixels. The default value is 200 pixels. If set to "Auto" the height of the popup will depend on the height of the treeview.

Parameters

value System.String

The value for Height

IgnoreCase(System.Boolean)

If set to false case-sensitive search will be performed to find suggestions. The widget performs case-insensitive searching by default.

Parameters

value System.Boolean

The value for IgnoreCase

MinLength(System.Int32)

The minimum number of characters the user must type before a search is performed. Set to a higher value if the search could match a lot of items.

Parameters

value System.Int32

The value for MinLength

NoDataTemplate(System.String)

The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.

Parameters

value System.String

The value for NoDataTemplate

NoDataTemplateId(System.String)

The template used to render the "no data" template, which will be displayed if no results are found or the underlying data source is empty. The noData template receives the widget itself as a part of the data argument. The template will be evaluated on every widget data bound.

Parameters

templateId System.String

The ID of the template element for NoDataTemplate

Placeholder(System.String)

The hint displayed by the widget when it is empty. Not set by default.

Parameters

value System.String

The value for Placeholder

Popup(System.Action<Kendo.Mvc.UI.Fluent.PopupSettingsBuilder>)

Configures the popup settings of the widget.

HeaderTemplate(System.String)

Specifies a static HTML content, which will be rendered as a header of the popup element.

Parameters

value System.String

The value for HeaderTemplate

HeaderTemplateId(System.String)

Specifies a static HTML content, which will be rendered as a header of the popup element.

Parameters

templateId System.String

The ID of the template element for HeaderTemplate

ValueTemplate(System.String)

The template used to render the value and the or the selected tags.

Parameters

value System.String

The value for ValueTemplate

ValueTemplateId(System.String)

The template used to render the value and the or the selected tags.

Parameters

templateId System.String

The ID of the template element for ValueTemplate

TagMode(Kendo.Mvc.UI.TagMode)

Represents available tag modes of DropDownTree.

Parameters

value Kendo.Mvc.UI.TagMode

The value for TagMode

Text(System.String)

The text of the widget used when the autoBind is set to false.

Parameters

value System.String

The value for Text

Value(System.String)

Define the value of the widget. It accepts 'String' when it is in single selection mode and 'Array' when multiple selection is enabled via checkboxes property.

Parameters

value System.String

The value for Value

Value(System.Collections.IEnumerable)

Sets the value of the widget.

Example (ASPX)

<%= Html.Kendo().DropDownTree()
    .Name("DropDownTree")
    .Value(new string[] { "1" })
%>

ValuePrimitive(System.Boolean)

Specifies the value binding behavior for the widget. If set to true, the View-Model field will be updated with the selected item value field. If set to false, the View-Model field will be updated with the selected item.

Parameters

value System.Boolean

The value for ValuePrimitive

Filter(System.String)

The filtering method used to determine the suggestions for the current value. Filtration is turned off by default.

Parameters

value System.String

The value for Filter