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

Defines the fluent interface for configuring the ContextMenu events.

Definition

Constructors

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

Methods

Defines the inline handler of the Activate client-side event

C#
public virtual ContextMenuEventBuilder Activate(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ContextMenuEventBuilder

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

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

C#
public virtual ContextMenuEventBuilder Activate(string handler)
Parameters:handlerstring

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

Returns:

ContextMenuEventBuilder

Example:
C#
@( Html.Kendo().ContextMenu()
.Name("ContextMenu")
.Events(events =&gt; events.Activate("onActivate"))
)

Defines the inline handler of the Close client-side event

C#
public virtual ContextMenuEventBuilder Close(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ContextMenuEventBuilder

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

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

C#
public virtual ContextMenuEventBuilder Close(string handler)
Parameters:handlerstring

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

Returns:

ContextMenuEventBuilder

Example:
C#
@( Html.Kendo().ContextMenu()
.Name("ContextMenu")
.Events(events =&gt; events.Close("onClose"))
)

Defines the inline handler of the Deactivate client-side event

C#
public virtual ContextMenuEventBuilder Deactivate(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ContextMenuEventBuilder

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

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

C#
public virtual ContextMenuEventBuilder Deactivate(string handler)
Parameters:handlerstring

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

Returns:

ContextMenuEventBuilder

Example:
C#
@( Html.Kendo().ContextMenu()
.Name("ContextMenu")
.Events(events =&gt; events.Deactivate("onDeactivate"))
)

Defines the inline handler of the Open client-side event

C#
public virtual ContextMenuEventBuilder Open(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ContextMenuEventBuilder

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

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

C#
public virtual ContextMenuEventBuilder Open(string handler)
Parameters:handlerstring

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

Returns:

ContextMenuEventBuilder

Example:
C#
@( Html.Kendo().ContextMenu()
.Name("ContextMenu")
.Events(events =&gt; events.Open("onOpen"))
)

Defines the inline handler of the Select client-side event

C#
public virtual ContextMenuEventBuilder Select(Func<object, object> handler)
Parameters:handlerFunc<object, object>

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

Returns:

ContextMenuEventBuilder

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

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

C#
public virtual ContextMenuEventBuilder Select(string handler)
Parameters:handlerstring

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

Returns:

ContextMenuEventBuilder

Example:
C#
@( Html.Kendo().ContextMenu()
.Name("ContextMenu")
.Events(events =&gt; events.Select("onSelect"))
)