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

Defines the fluent API for configuring the Kendo UI 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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the ListView is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

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

The handler code wrapped in a text tag.

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

Defines the handler of the KendoKeydown client-side event. Triggered when the user presses a keyboard key while the ListView is focused.The event handler function context (available via the this keyword) will be set to the widget instance.

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

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

Defines the handler of the Remove client-side event. Fires before the list view item is put in edit mode. If the event is not prevented, the ListView will call the DataSource sync method.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.

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

Defines the handler of the Remove client-side event. Fires before the list view item is put in edit mode. If the event is not prevented, the ListView will call the DataSource sync method.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 Remove event.

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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

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

Returns:

ListViewEventBuilder

Returns the current instance of 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;
))
)

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

Returns:

ListViewEventBuilder

Returns the current instance of ListViewEventBuilder .

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