New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent interface for configuring the DropDownTree component.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class DropDownTreeBuilder : WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>, IHtmlString

Inheritance: objectWidgetBuilderBase<DropDownTree, DropDownTreeBuilder>DropDownTreeBuilder

Implements: IHtmlString

Inherited Members WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ToComponent()WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.Name(string)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.Deferred(bool)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ModelMetadata(ModelMetadata)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.HtmlAttributes(object)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.HtmlAttributes(IDictionary<string, object>)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.AsModule(bool)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.Render()WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ScriptAttributes(object, bool)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ScriptAttributes(IDictionary<string, object>, bool)WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ToHtmlString()WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ToClientTemplate()WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.ToString()WidgetBuilderBase<DropDownTree, DropDownTreeBuilder>.Componentobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

Initializes a new instance of the DropDownTreeBuilder class.

C#
public DropDownTreeBuilder(DropDownTree component)
Parameters:componentDropDownTree

The component.

Methods

Specifies the adaptive rendering of the component.

C#
public DropDownTreeBuilder AdaptiveMode(AdaptiveMode value)
Parameters:valueAdaptiveMode

The value for AdaptiveMode.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.AdaptiveMode(AdaptiveMode.Auto)
)

Allows customization of the subtitle's text in the adaptive view of the component.

C#
public DropDownTreeBuilder AdaptiveSubtitle(string value)
Parameters:valuestring

The value that configures the adaptivesubtitle.

Returns:

DropDownTreeBuilder

Allows customization of the title's text in the adaptive view of the component.

C#
public DropDownTreeBuilder AdaptiveTitle(string value)
Parameters:valuestring

The value that configures the adaptivetitle.

Returns:

DropDownTreeBuilder

Configures the animation effects of the widget.

C#
public DropDownTreeBuilder Animation(Action<PopupAnimationBuilder> animationAction)
Parameters:animationActionAction<PopupAnimationBuilder>

The action which configures the animation effects.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Animation(animation =&gt;
{
animation.Open(open =&gt;
{
open.SlideIn(SlideDirection.Down);
});
})
)

Use to enable or disable animation of the DropDownTree.

C#
public DropDownTreeBuilder Animation(bool enable)
Parameters:enablebool

The boolean value.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Animation(false) //toggle effect
)

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

C#
public DropDownTreeBuilder AutoBind(bool autoBind)
Parameters:autoBindbool

The value for autoBind

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.AutoBind(false)
)

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

C#
public DropDownTreeBuilder AutoClose(bool autoClose)
Parameters:autoClosebool

The value for AutoClose

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.AutoClose(true)
)

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

C#
public DropDownTreeBuilder AutoWidth(bool autoWidth)
Parameters:autoWidthbool

The value for AutoWidth

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.AutoWidth(true)
)

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

C#
public DropDownTreeBuilder BindTo(IEnumerable dataSource, Action<NavigationBindingFactory<DropDownTreeItem>> factoryAction)
Parameters:dataSourceIEnumerable

The data source.

factoryActionAction<NavigationBindingFactory<DropDownTreeItem>>

The action which will configure the mappings

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.BindTo(Model, mapping =&gt; mapping
.For&lt;Customer&gt;(binding =&gt; binding
.Children(c =&gt; c.Orders) // The "child" items will be bound to the "Orders" property
.ItemDataBound((item, c) =&gt; item.Text = c.ContactName) // Map "Customer" properties to DropDownTreeItem properties
)
.For&lt;Order&lt;(binding =&gt; binding
.Children(o =&gt; null) // "Orders" do not have child objects so return "null"
.ItemDataBound((item, o) =&gt; item.Text = o.OrderID.ToString()) // Map "Order" properties to DropDownTreeItem properties
)
)
)

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.

C#
public DropDownTreeBuilder BindTo(IEnumerable<DropDownTreeItemModel> items)
Parameters:itemsIEnumerable<DropDownTreeItemModel>

The list of items

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.BindTo(model)
)

Binds the DropDownTree to a sitemap

C#
public DropDownTreeBuilder BindTo(string viewDataKey, Action<DropDownTreeItem, SiteMapNode> siteMapAction)
Parameters:viewDataKeystring

The view data key.

siteMapActionAction<DropDownTreeItem, SiteMapNode>

The action to configure the item.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.BindTo("examples", (item, siteMapNode) =&gt;
{
})
)

Binds the DropDownTree to a sitemap.

C#
public DropDownTreeBuilder BindTo(string viewDataKey)
Parameters:viewDataKeystring

The view data key.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.BindTo("examples")
)

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.

C#
public DropDownTreeBuilder BindTo<T>(IEnumerable<T> dataSource, Action<DropDownTreeItem, T> itemDataBound)
Parameters:dataSourceIEnumerable<T>

The data source.

itemDataBoundAction<DropDownTreeItem, T>

The action executed for every data bound item.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.BindTo(new []{"First", "Second"}, (item, value) =&gt;
{
item.Text = value;
})
)

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.

C#
public DropDownTreeBuilder CheckAll(bool checkAll)
Parameters:checkAllbool

The value for CheckAll

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.CheckAll(true)
.Checkboxes(true)
)

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

C#
public DropDownTreeBuilder CheckAllTemplate(string value)
Parameters:valuestring

The value for CheckAllTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.CheckAllTemplate("Check All Label")
)

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

C#
public DropDownTreeBuilder CheckAllTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the "checkAll" label template.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.CheckAll(true)
.CheckAllTemplate(Html.Kendo().Template().AddHtml("&lt;h2&gt;Check ALL items&lt;/h2&gt;"))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the checkAll label of the dropdowntree.

C#
public DropDownTreeBuilder CheckAllTemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.CheckAllTemplateHandler("checkAllTemplateHandler")
)

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

C#
public DropDownTreeBuilder CheckAllTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for CheckAllTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TemplateId("widgetTemplateId")
)

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

C#
public DropDownTreeBuilder CheckAllTemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains CheckAllTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.CheckAllTemplateView(Html.Partial("TemplateView"))
)

Configures rendering of checkboxes in the dropdowntree.

C#
public DropDownTreeBuilder Checkboxes(Action<DropDownTreeCheckboxesBuilder> configure)
Parameters:configureAction<DropDownTreeCheckboxesBuilder>

Builder of the dropdowntree checkboxes configuration.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Checkboxes(config =&gt; config
.CheckChildren(true)
)
)

Enable/disable rendering of checkboxes in the dropdowntree.

C#
public DropDownTreeBuilder Checkboxes(bool enabled)
Parameters:enabledbool

Whether checkboxes should be rendered.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Checkboxes(true)
)

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.

C#
public DropDownTreeBuilder ClearButton(bool value)
Parameters:valuebool

The value for ClearButton

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ClearButton(false)
)

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

C#
public DropDownTreeBuilder DataImageUrlField(string value)
Parameters:valuestring

The value that configures the dataimageurlfield.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataImageUrlField("ImageUrl")
)

Configure the DataSource of the component

C#
public DropDownTreeBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
Parameters:configuratorAction<HierarchicalDataSourceBuilder<object>>

The action that configures the DataSource.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataSource(dataSource =&gt; dataSource
.Read(read =&gt; read
.Action("Employees", "DropDownTree")
)
)
)

Accepts the Name of the external DataSource component that is to be used for data binding

C#
public DropDownTreeBuilder DataSource(string dataSourceId)
Parameters:dataSourceIdstring

The name of the external DataSource.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataSource("dataSourceName")
)

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.

C#
public DropDownTreeBuilder DataSpriteCssClassField(string value)
Parameters:valuestring

The value that configures the dataspritecssclassfield.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataSpriteCssClassField("SpriteCssClass")
)

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.

C#
public DropDownTreeBuilder DataTextField(params string[] value)
Parameters:valuestring[]

The value that configures the datatextfield.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataTextField([{"Name"}])
)

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.

C#
public DropDownTreeBuilder DataTextField(string value)
Parameters:valuestring

The value that configures the datatextfield.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataTextField("Name")
)

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

C#
public DropDownTreeBuilder DataUrlField(string value)
Parameters:valuestring

The value that configures the dataurlfield.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataUrlField("Url")
)

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.

C#
public DropDownTreeBuilder DataValueField(string value)
Parameters:valuestring

The value for DataValueField

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.DataValueField("Value")
)

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

C#
public DropDownTreeBuilder Delay(int value)
Parameters:valueint

The value for Delay

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Delay(300)
)

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.

C#
public DropDownTreeBuilder Enable(bool value)
Parameters:valuebool

The value for Enable

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Enable(false)
)

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.

C#
public DropDownTreeBuilder EnforceMinLength(bool value)
Parameters:valuebool

The value for EnforceMinLength

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.MinLength(3)
.EnforceMinLength(true)
)

Configures the client-side events.

C#
public DropDownTreeBuilder Events(Action<DropDownTreeEventBuilder> clientEventsAction)
Parameters:clientEventsActionAction<DropDownTreeEventBuilder>

The client events action.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Events(events =&gt;
.OnDataBinding("onDataBinding")
.OnItemDataBound("onItemDataBound")
)
)

Sets a value controlling how the color is applied to the DropDownTree.

C#
public DropDownTreeBuilder FillMode(FillMode value)
Parameters:valueFillMode

The value for FillMode

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FillMode(FillMode.Solid)
)

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

C#
public DropDownTreeBuilder Filter(string value)
Parameters:valuestring

The value for Filter

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValuePrimitive(true)
)

When filtering is enabled, allows aria-label to be defined for the filter input element.

C#
public DropDownTreeBuilder FilterLabel(string value)
Parameters:valuestring

The value for FilterLabel

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FilterLabel("Filter")
)

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.

C#
public DropDownTreeBuilder FooterTemplate(string value)
Parameters:valuestring

The value for FooterTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FooterTemplate("Footer Text")
)

Defines the template that renders the footer of the DropDownTree.

C#
public DropDownTreeBuilder FooterTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the footer.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.FooterTemplate(Html.Kendo().Template().AddHtml("Total &lt;strong&gt;${data.instance.dataSource.total()}&lt;/strong&gt; items found"))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the footer of the dropdowntree.

C#
public DropDownTreeBuilder FooterTemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FooterTemplateHandler("footerTemplateHandler")
)

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.

C#
public DropDownTreeBuilder FooterTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for FooterTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FooterTemplateId("footerTemplate")
)

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.

C#
public DropDownTreeBuilder FooterTemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains FooterTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.FooterTemplateView(Html.Partial("Template"))
)

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

C#
public DropDownTreeBuilder HeaderTemplate(string value)
Parameters:valuestring

The value for HeaderTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.HeaderTemplate("Custom Header")
)

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

C#
public DropDownTreeBuilder HeaderTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the header of the popup element.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.HeaderTemplate(Html.Kendo().Template().AddHtml("&lt;div&gt;Countries:&lt;/div&gt;"))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the header content in the dropdowntree.

C#
public DropDownTreeBuilder HeaderTemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.HeaderTemplateHandler("headerTemplateHandler")
)

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

C#
public DropDownTreeBuilder HeaderTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for HeaderTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.HeaderTemplateId("headerTemplate")
)

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

C#
public DropDownTreeBuilder HeaderTemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains the HeaderTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.HeaderTemplateView(Html.Partial("Template"))
)

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.

C#
public DropDownTreeBuilder Height(string value)
Parameters:valuestring

The value for Height

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Height("Auto")
)

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

C#
public DropDownTreeBuilder IgnoreCase(bool value)
Parameters:valuebool

The value for IgnoreCase

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.IgnoreCase(false)
)

Defines the items in the DropDownTree through the DropDownTreeItemFactory

C#
public DropDownTreeBuilder Items(Action<DropDownTreeItemFactory> addAction)
Parameters:addActionAction<DropDownTreeItemFactory>

The add action.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Items(items =&gt;
{
items.Add().Text("First Item");
items.Add().Text("Second Item");
})
)

Uses the DropDownTreeLabelSettingsBuilder Action configurator to add a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

C#
public DropDownTreeBuilder Label(Action<DropDownTreeLabelSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownTreeLabelSettingsBuilder>Returns:

DropDownTreeBuilder

Indicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to true causes loading the child DataSources when expanding the parent node.

C#
public DropDownTreeBuilder LoadOnDemand()
Returns:

DropDownTreeBuilder

Indicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to true causes loading the child DataSources when expanding the parent node.

C#
public DropDownTreeBuilder LoadOnDemand(Action<DropDownTreeLoadOnDemandSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownTreeLoadOnDemandSettingsBuilder>

The configurator for the loadondemand setting.

Returns:

DropDownTreeBuilder

Indicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to true causes loading the child DataSources when expanding the parent node.

C#
public DropDownTreeBuilder LoadOnDemand(bool enabled)
Parameters:enabledbool

Enables or disables the loadondemand option.

Returns:

DropDownTreeBuilder

The DropDownTreeMessagesSettingsBuilder that configures the messages displayed in the widget. Use it to customize or localize the messages.

C#
public DropDownTreeBuilder Messages(Action<DropDownTreeMessagesSettingsBuilder> configurator)
Parameters:configuratorAction<DropDownTreeMessagesSettingsBuilder>

The action that configures the messages.

Returns:

DropDownTreeBuilder

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.

C#
public DropDownTreeBuilder MinLength(int value)
Parameters:valueint

The value for MinLength

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.MinLength(3)
)

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.

C#
public DropDownTreeBuilder NoDataTemplate(string value)
Parameters:valuestring

The value for NoDataTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.NoDataTemplate("No items are available")
)

Defines the template that renders the "no data" template, which will be displayed if no results are found or the underlying DataSource is empty. The template will be evaluated on every component's data bound.

C#
public DropDownTreeBuilder NoDataTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the "no data" template.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.NoDataTemplate(Html.Kendo().Template().AddHtml("No available options."))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the message when no data loaded in the dropdowntree.

C#
public DropDownTreeBuilder NoDataTemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.NoDataTemplateHandler("noDataTemplateHandler")
)

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.

C#
public DropDownTreeBuilder NoDataTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for NoDataTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.NoDataTemplateId("noDataTemplate")
)

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.

C#
public DropDownTreeBuilder NoDataTemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains NoDataTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.NoDataTemplateView(Html.Partial("Template"))
)

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

C#
public DropDownTreeBuilder Placeholder(string value)
Parameters:valuestring

The value for Placeholder

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Placeholder("Select an item")
)

Configures the PopupSettingsBuilder of the widget.

C#
public DropDownTreeBuilder Popup(Action<PopupSettingsBuilder> popupAction)
Parameters:popupActionAction<PopupSettingsBuilder>

The PopupSettingsBuilder Action responsible for the configuration of the Popup.

Returns:

DropDownTreeBuilder

Sets the border radius of the DropDownTree.

C#
public DropDownTreeBuilder Rounded(Rounded? value)
Parameters:valueRounded?

The value for Rounded

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Rounded(Rounded.Medium)
)

Sets the size of the component with a parameter of type ComponentSize

C#
public DropDownTreeBuilder Size(ComponentSize? value)
Parameters:valueComponentSize?

The value for Size

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Size(ComponentSize.Medium)
)

Represents available tag modes of DropDownTree. Available configurations are DropDownTreeTagMode.Single and DropDownTreeTagMode.Multiple

C#
public DropDownTreeBuilder TagMode(TagMode value)
Parameters:valueTagMode

The value for TagMode

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TagMode(DropDownTreeTagMode.Single)
)

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

C#
public DropDownTreeBuilder Template(string template)
Parameters:templatestringReturns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.Template("#= data #")
)

Defines the template that renders each DropDownTree item.

C#
public DropDownTreeBuilder Template<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures each item's template.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.Template(Html.Kendo().Template().AddHtml("Option: ${data.item.text}"))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the items in the dropdowntree.

C#
public DropDownTreeBuilder TemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TemplateHandler("templateHandler")
)

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

C#
public DropDownTreeBuilder TemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for TemplateId

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TemplateId("widgetTemplateId")
)

A Partial View to be used for the rendering of the items in the dropdowntree.

C#
public DropDownTreeBuilder TemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains the items template

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TemplateView(Html.Partial("TemplateView"))
)

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

C#
public DropDownTreeBuilder Text(string value)
Parameters:valuestring

The value for Text

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.AutoBind(false)
.Text("Default Text")
)

Define the value of the widget. It accepts an 'Array' when multiple selection is enabled via checkboxes property.

C#
public DropDownTreeBuilder Value(IEnumerable value)
Parameters:valueIEnumerable

The value array for Value

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TagMode(DropDownTreeTagMode.Multiple)
.Value(new string[] { "1" })
)

Define the value of the widget. It accepts 'String' when it is in single selection mode.

C#
public DropDownTreeBuilder Value(string value)
Parameters:valuestring

The value string for Value

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.TagMode(DropDownTreeTagMode.Single)
.Value("1")
)

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.

C#
public DropDownTreeBuilder ValuePrimitive(bool value)
Parameters:valuebool

The value for ValuePrimitive

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValuePrimitive(true)
)

The template used to render the selected tags.

C#
public DropDownTreeBuilder ValueTemplate(string value)
Parameters:valuestring

The value for ValueTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValueTemplate(#= data.Value #)
)

Defines the template used to render the selected value of the DropDownTree.

C#
public DropDownTreeBuilder ValueTemplate<TModel>(TemplateBuilder<TModel> template)
Parameters:templateTemplateBuilder<TModel>

A Template component that configures the selected value template.

Returns:

DropDownTreeBuilder

Example:
C#
@(Html.Kendo().DropDownTree()
.Name("dropDownTree")
.ValueTemplate(Html.Kendo().Template().AddHtml("Item: ${data.text}"))
)

Specifies a JavaScript function name. The value returned by thе function will bе used to render the selected value of the dropdowntree.

C#
public DropDownTreeBuilder ValueTemplateHandler(string value)
Parameters:valuestring

The name of the JavaScript function that will handle the template evaluation.

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValueHandler("valueTemplateHandler")
)

The template used to render the selected tags.

C#
public DropDownTreeBuilder ValueTemplateId(string templateId)
Parameters:templateIdstring

The ID of the template element for ValueTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValueTemplateId("valueTemplate")
)

The template used to render the selected tags.

C#
public DropDownTreeBuilder ValueTemplateView(MvcHtmlString templateView)
Parameters:templateViewMvcHtmlString

The view that contains the ValueTemplate

Returns:

DropDownTreeBuilder

Example:
C#
@( Html.Kendo().DropDownTree()
.Name("DropDownTree")
.ValueTemplateView(Html.Partial("Template"))
)
In this article
DefinitionConstructorsDropDownTreeBuilder(DropDownTree)MethodsAdaptiveMode(AdaptiveMode)AdaptiveSubtitle(string)AdaptiveTitle(string)Animation(Action<PopupAnimationBuilder>)Animation(bool)AutoBind(bool)AutoClose(bool)AutoWidth(bool)BindTo(IEnumerable, Action<NavigationBindingFactory<DropDownTreeItem>>)BindTo(IEnumerable<DropDownTreeItemModel>)BindTo(string, Action<DropDownTreeItem, SiteMapNode>)BindTo(string)BindTo<T>(IEnumerable<T>, Action<DropDownTreeItem, T>)CheckAll(bool)CheckAllTemplate(string)CheckAllTemplate<TModel>(TemplateBuilder<TModel>)CheckAllTemplateHandler(string)CheckAllTemplateId(string)CheckAllTemplateView(MvcHtmlString)Checkboxes(Action<DropDownTreeCheckboxesBuilder>)Checkboxes(bool)ClearButton(bool)DataImageUrlField(string)DataSource(Action<HierarchicalDataSourceBuilder<object>>)DataSource(string)DataSpriteCssClassField(string)DataTextField(params string[])DataTextField(string)DataUrlField(string)DataValueField(string)Delay(int)Enable(bool)EnforceMinLength(bool)Events(Action<DropDownTreeEventBuilder>)FillMode(FillMode)Filter(string)FilterLabel(string)FooterTemplate(string)FooterTemplate<TModel>(TemplateBuilder<TModel>)FooterTemplateHandler(string)FooterTemplateId(string)FooterTemplateView(MvcHtmlString)HeaderTemplate(string)HeaderTemplate<TModel>(TemplateBuilder<TModel>)HeaderTemplateHandler(string)HeaderTemplateId(string)HeaderTemplateView(MvcHtmlString)Height(string)IgnoreCase(bool)Items(Action<DropDownTreeItemFactory>)Label(Action<DropDownTreeLabelSettingsBuilder>)LoadOnDemand()LoadOnDemand(Action<DropDownTreeLoadOnDemandSettingsBuilder>)LoadOnDemand(bool)Messages(Action<DropDownTreeMessagesSettingsBuilder>)MinLength(int)NoDataTemplate(string)NoDataTemplate<TModel>(TemplateBuilder<TModel>)NoDataTemplateHandler(string)NoDataTemplateId(string)NoDataTemplateView(MvcHtmlString)Placeholder(string)Popup(Action<PopupSettingsBuilder>)Rounded(Rounded?)Size(ComponentSize?)TagMode(TagMode)Template(string)Template<TModel>(TemplateBuilder<TModel>)TemplateHandler(string)TemplateId(string)TemplateView(MvcHtmlString)Text(string)Value(IEnumerable)Value(string)ValuePrimitive(bool)ValueTemplate(string)ValueTemplate<TModel>(TemplateBuilder<TModel>)ValueTemplateHandler(string)ValueTemplateId(string)ValueTemplateView(MvcHtmlString)
Not finding the help you need?
Contact Support