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

TreeViewEventBuilder

Methods

Change(System.String)

Triggered when the selection has changed (either by the user or through the select method).

For more information see Change event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the change event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Change("onChange"))
            )

Check(System.String)

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.

For more information see Check event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the check event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Check("onCheck"))
            )

Collapse(System.String)

Triggered before a subgroup gets collapsed. Cancellable.

For more information see Collapse event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the collapse event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Collapse("onCollapse"))
            )

DataBound(System.String)

Triggered after the dataSource change event has been processed (adding/removing items);

For more information see DataBound event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the dataBound event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.DataBound("onDataBound"))
            )

Drag(System.String)

Triggered while a node is being dragged.

For more information see Drag event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the drag event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Drag("onDrag"))
            )

DragEnd(System.String)

Triggered after a node has been dropped.

For more information see DragEnd event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the dragend event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.DragEnd("onDragEnd"))
            )

DragStart(System.String)

Triggered before the dragging of a node starts.

For more information see DragStart event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the dragstart event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.DragStart("onDragStart"))
            )

Drop(System.String)

Triggered when a node is being dropped.

For more information see Drop event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the drop event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Drop("onDrop"))
            )

Expand(System.String)

Triggered before a subgroup gets expanded.

For more information see Expand event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the expand event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Expand("onExpand"))
            )

LoadCompleted(System.String)

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.

For more information see LoadCompleted event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the loadCompleted event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.LoadCompleted("onLoadCompleted"))
            )

KendoKeydown(System.String)

Triggered when the user presses a keyboard key while the TreeView is focused.

For more information see KendoKeydown event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the kendoKeydown event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.KendoKeydown("onKendoKeydown"))
            )

Triggered when the user moves the focus on another node

For more information see Navigate event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the navigate event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Navigate("onNavigate"))
            )

Select(System.String)

Triggered when a node is being selected by the user. Cancellable.

For more information see Select event.

Parameters

handler - System.String

The name of the JavaScript function that will handle the select event.

Example


             @( Html.Kendo().TreeView()
                        .Name("treeview")
                        .Events(e => e.Select("onSelect"))
            )

Collapse(System.Func)

Defines the inline handler of the collapse client-side event

For more information see Collapse event.

Parameters

onCollapseAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Collapse(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

DataBound(System.Func)

Defines the inline handler of the dataBound client-side event

For more information see DataBound event.

Parameters

onDataBoundAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.DataBound(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Drag(System.Func)

Defines the inline handler of the drag client-side event

For more information see Drag event.

Parameters

onDragAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Drag(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

DragEnd(System.Func)

Defines the inline handler of the dragend client-side event

For more information see DragEnd event.

Parameters

onDragEndAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.DragEnd(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

DragStart(System.Func)

Defines the inline handler of the dragstart client-side event

For more information see DragStart event.

Parameters

onDragStartAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.DragStart(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Drop(System.Func)

Defines the inline handler of the drop client-side event

For more information see Drop event.

Parameters

onDropAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Drop(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Expand(System.Func)

Defines the inline handler of the expand client-side event

For more information see Expand event.

Parameters

onExpandAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Expand(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Select(System.Func)

Defines the inline handler of the select client-side event

For more information see Select event.

Parameters

onSelectAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Select(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Change(System.Func)

Defines the inline handler of the change client-side event

For more information see Change event.

Parameters

onChangeAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Change(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

Check(System.Func)

Defines the inline handler of the check client-side event

For more information see Check event.

Parameters

onCheckAction - System.Func<Object,Object>

The handler code wrapped in a text tag (Razor syntax).

Example


            @( Html.Kendo().TreeView()
                      .Name("TreeView")
                      .Events(events => events.Check(
                           @<text>
                           function(e) {
                               // event handling code
                           }
                           </text>
                      ))
                      .Render();
            )

In this article
Not finding the help you need?