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

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

Definition

Constructors

Initializes a new instance of the ListViewEventBuilder class.

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

The ListView event handlers.

Methods

Fired when the user clicks the "cancel" button. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Cancel(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(e =&gt; e.Cancel(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Fired when the user clicks the "cancel" button. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Cancel(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.Cancel("onCancel"))
)

Fires when the ListView selection has changed. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Change(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

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

Fires when the ListView selection has changed. The event handler function context (available via the this keyword) will be set to the widget instance.

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

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.Change("onChange"))
)

Fires when the ListView is about to be bound. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder DataBinding(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(e =&gt; e.DataBinding(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Fires when the ListView is about to be bound. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder DataBinding(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.DataBinding("onDataBinding"))
)

Fires when the ListView has received data from the DataSource and it is already rendered. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder DataBound(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

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

Fires when the ListView has received data from the DataSource and it is already rendered. The event handler function context (available via the this keyword) will be set to the widget instance.

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

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.DataBound("onDataBound"))
)

Fires when the ListView enters edit mode. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Edit(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(e =&gt; e.Edit(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Fires when the ListView enters edit mode. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Edit(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.Edit("onEdit"))
)

Defines the inline handler of the KendoKeydown client-side event

C#
public virtual ListViewEventBuilder KendoKeydown(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Defines the name of the JavaScript function that will handle the KendoKeydown client-side event.

C#
public virtual ListViewEventBuilder KendoKeydown(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Fires before an item is removed. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Remove(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(e =&gt; e.Remove(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Fires before an item is removed. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Remove(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.Remove("onRemove"))
)

Fired when a data item is saved. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Save(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(e =&gt; e.Save(
@&lt;text&gt;
function(e){
event handling code
}
&lt;/text&gt;
))
)

Fired when a data item is saved. The event handler function context (available via the this keyword) will be set to the widget instance.

C#
public ListViewEventBuilder Save(string handler)
Parameters:handlerstring

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

Returns:

ListViewEventBuilder

Example:
C#
@(Html.Kendo().ListView&lt;ProductViewModel&gt;()
.Name("productsListView")
.Events(events =&gt; events.Save("onSave"))
)