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

Defines the fluent interface for configuring the DataSource component client-side events.

Definition

Constructors

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

Methods

Defines the inline handler of the Change client-side event.

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

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.Change(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

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

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.Change("onChangeDS"))
)

Defines the inline handler of the Error client-side event.

C#
public DataSourceEventBuilder Error(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.Error(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

C#
public DataSourceEventBuilder Error(string handler)
Parameters:handlerstring

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.Error("onErrorDS"))
)

Defines the inline handler of the Push client-side event.

C#
public DataSourceEventBuilder Push(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.Push(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

C#
public DataSourceEventBuilder Push(string handler)
Parameters:handlerstring

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.Push("onPushDS"))
)

Defines the inline handler of the RequestEnd client-side event.

C#
public DataSourceEventBuilder RequestEnd(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.RequestEnd(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

C#
public DataSourceEventBuilder RequestEnd(string handler)
Parameters:handlerstring

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.RequestEnd("onRequestEndDS"))
)

Defines the inline handler of the RequestStart client-side event.

C#
public DataSourceEventBuilder RequestStart(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.RequestStart(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

C#
public DataSourceEventBuilder RequestStart(string handler)
Parameters:handlerstring

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.RequestStart("onRequestStartDS"))
)

Defines the inline handler of the Sync client-side event.

C#
public DataSourceEventBuilder Sync(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(events =&gt; events.Sync(
@&lt;text&gt;
function(e) {
//event handling code
}
&lt;/text&gt;
))
)

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

C#
public DataSourceEventBuilder Sync(string handler)
Parameters:handlerstring

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

Returns:

DataSourceEventBuilder

Example:
C#
.DataSource(dataSource =&gt; dataSource
.Ajax()
.Events(e =&gt; e.Sync("onSyncDS"))
)