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

Defines the fluent API for configuring the events of the Kendo TreeView for ASP.NET MVC

Definition

Constructors

C#
public TreeViewEventBuilder(IDictionary<string, object> events)
Parameters:eventsIDictionary<string, object>

Methods

Defines the inline handler of the change client-side event

C#
public TreeViewEventBuilder Change(Func<object, object> onChangeAction)
Parameters:onChangeActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Change(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Change client-side event. Triggered when the selection has changed (either by the user or through the select method).

C#
public TreeViewEventBuilder Change(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Change("onChange"))
)

Defines the inline handler of the check client-side event

C#
public TreeViewEventBuilder Check(Func<object, object> onCheckAction)
Parameters:onCheckActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Check(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Check client-side 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.

C#
public TreeViewEventBuilder Check(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Check("onCheck"))
)

Defines the inline handler of the collapse client-side event

C#
public TreeViewEventBuilder Collapse(Func<object, object> onCollapseAction)
Parameters:onCollapseActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Collapse(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Collapse client-side event. Triggered before a subgroup gets collapsed. Cancellable.

C#
public TreeViewEventBuilder Collapse(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Collapse("onCollapse"))
)

Defines the inline handler of the dataBound client-side event

C#
public TreeViewEventBuilder DataBound(Func<object, object> onDataBoundAction)
Parameters:onDataBoundActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.DataBound(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the DataBound client-side event. Triggered after the dataSource change event has been processed (adding/removing items);

C#
public TreeViewEventBuilder DataBound(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.DataBound("onDataBound"))
)

Defines the inline handler of the drag client-side event

C#
public TreeViewEventBuilder Drag(Func<object, object> onDragAction)
Parameters:onDragActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Drag(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Drag client-side event. Triggered while a node is being dragged.

C#
public TreeViewEventBuilder Drag(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Drag("onDrag"))
)

Defines the inline handler of the dragend client-side event

C#
public TreeViewEventBuilder DragEnd(Func<object, object> onDragEndAction)
Parameters:onDragEndActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.DragEnd(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the DragEnd client-side event. Triggered after a node has been dropped.

C#
public TreeViewEventBuilder DragEnd(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.DragEnd("onDragEnd"))
)

Defines the inline handler of the dragstart client-side event

C#
public TreeViewEventBuilder DragStart(Func<object, object> onDragStartAction)
Parameters:onDragStartActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.DragStart(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the DragStart client-side event. Triggered before the dragging of a node starts.

C#
public TreeViewEventBuilder DragStart(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.DragStart("onDragStart"))
)

Defines the inline handler of the drop client-side event

C#
public TreeViewEventBuilder Drop(Func<object, object> onDropAction)
Parameters:onDropActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Drop(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Drop client-side event. Triggered when a node is being dropped.

C#
public TreeViewEventBuilder Drop(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Drop("onDrop"))
)

Defines the inline handler of the expand client-side event

C#
public TreeViewEventBuilder Expand(Func<object, object> onExpandAction)
Parameters:onExpandActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Expand(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Expand client-side event. Triggered before a subgroup gets expanded.

C#
public TreeViewEventBuilder Expand(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Expand("onExpand"))
)

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the TreeView is focused.

C#
public TreeViewEventBuilder KendoKeydown(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.KendoKeydown("onKendoKeydown"))
)

Defines the handler of the LoadCompleted client-side 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.

C#
public TreeViewEventBuilder LoadCompleted(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.LoadCompleted("onLoadCompleted"))
)

Defines the handler of the Navigate client-side event. Triggered when the user moves the focus on another node

C#
public TreeViewEventBuilder Navigate(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Navigate("onNavigate"))
)

Defines the inline handler of the select client-side event

C#
public TreeViewEventBuilder Select(Func<object, object> onSelectAction)
Parameters:onSelectActionFunc<object, object>

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("TreeView")
.Events(events =&gt; events.Select(
@&lt;text&gt;
function(e) {
// event handling code
}
&lt;/text&gt;
))
.Render();
)

Defines the handler of the Select client-side event. Triggered when a node is being selected by the user. Cancellable.

C#
public TreeViewEventBuilder Select(string handler)
Parameters:handlerstring

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

Returns:

TreeViewEventBuilder

Example:
C#
@( Html.Kendo().TreeView()
.Name("treeview")
.Events(e =&gt; e.Select("onSelect"))
)