TreeView

Example

Razor
<kendo-treeview>
    <animation></animation>
    <checkboxes></checkboxes>
    <drag-and-drop />
    <hierarchical-datasource></hierarchical-datasource>
    <item-template></item-template>
    <items></items>
    <messages />
</kendo-treeview>

ChildTags

Attributes

AttributeTypeDescription
nameStringSets the name of the component.
as-moduleBooleanSpecifies whether the initialization script of the component will be rendered as a JavaScript module.
is-in-client-templateBooleanWhen placing a Tag Helper within a Kendo Template, set the type to text/html and add the is-in-client-template="true" attribute.
auto-bindBooleanIf set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.
auto-scrollBooleanIf set to true the widget will auto-scroll the containing element when the mouse/finger is close to the top/bottom of it.
bind-toIEnumerable<TreeViewItemBase>Binds a list of items to the TreeView
deferredBooleanSuppress initialization script rendering. Note that this options should be used in conjunction with DeferredScripts method.
data-image-url-fieldStringSets the field of the data item that provides the image URL of the TreeView nodes.
data-source-idStringThe Id of the data source.
data-sprite-css-class-fieldStringSets 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.
data-text-fieldStringSets 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.
data-url-fieldStringSets the field of the data item that provides the link URL of the nodes.
drag-and-drop-enabledBooleanDisables (false) or enables (true) drag-and-drop of the nodes.
expand-allBooleanIf set to true expands all nodes. Applicable when local data binding is used.
load-on-demandBooleanIndicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to false causes all child DataSources to be loaded at initialization time.
on-changeStringThe name of the JavaScript function that will handle the change event. Triggered when the selection has changed (either by the user or through the select method).
on-checkStringThe name of the JavaScript function that will handle the check event. Triggered after the user has checked or unchecked a checkbox. If checkChildren is true, the event is triggered after all checked states are updated. This event has been introduced in internal builds after 2014.2.828.
on-collapseStringThe name of the JavaScript function that will handle the collapse event. Triggered before a subgroup gets collapsed. Cancellable.
on-data-boundStringThe name of the JavaScript function that will handle the dataBound event. Triggered after the dataSource change event has been processed (adding/removing items);
on-dragStringThe name of the JavaScript function that will handle the drag event. Triggered while a node is being dragged.
on-dragendStringThe name of the JavaScript function that will handle the dragend event. Triggered after a node has been dropped.
on-dragstartStringThe name of the JavaScript function that will handle the dragstart event. Triggered before the dragging of a node starts.
on-dropStringThe name of the JavaScript function that will handle the drop event. Triggered when a node is being dropped.
on-expandStringThe name of the JavaScript function that will handle the expand event. Triggered before a subgroup gets expanded.
on-kendo-keydownStringThe name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the TreeView is focused.
on-load-completedStringThe name of the JavaScript function that will handle the loadCompleted event. This event triggers only when loadOnDemand is set to false - it indicates that all nodes that need to be loaded are ready and present as data items in the DataSource of the TreeView.
on-navigateStringThe name of the JavaScript function that will handle the navigate event. Triggered when the user moves the focus on another node
on-selectStringThe name of the JavaScript function that will handle the select event. Triggered when a node is being selected by the user. Cancellable.
script-attributesIDictionary<String,Object>Sets the attributes that will be added to the script tag of the component's initialization script.
sizeComponentSizeSets the size of the component.
templateStringRepresents a collection of templates defined for the component.
template-handlerStringTemplate for rendering each node. This option expects the name of a JavaScript function that will be called to return the template.
template-idStringTemplate for rendering each node. This option expects the ID of the script element that contains the template.
template-viewIHtmlContentTemplate for rendering each node. This option expects the instance containing the created HTML.
In this article
ExampleChildTagsAttributes
Not finding the help you need?
Contact Support