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

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

Definition

Constructors

Initializes a new instance of the MenuEventBuilder class.

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

The Menu event handlers.

Methods

Defines the handler of the Activate client-side event. Fires when a sub menu gets opened and its animation finished.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Activate client-side event. Fires when a sub menu gets opened and its animation finished.

C#
public MenuEventBuilder Activate(string handler)
Parameters:handlerstring

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Close client-side event. Fires before a sub menu gets closed. You can cancel this event to prevent closure.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Close client-side event. Fires before a sub menu gets closed. You can cancel this event to prevent closure.

C#
public MenuEventBuilder Close(string handler)
Parameters:handlerstring

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the DataBound client-side event. Fires when the Menu is bound to the set DataSource.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the DataBound client-side event. Fires when the Menu is bound to the set DataSource.

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

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

Example:
C#
@( Html.Kendo().Menu()
.Name("Menu")
.Events(events =&gt; events.DataBound("handler"))
)

Defines the handler of the Deactivate client-side event. Fires when a sub menu gets closed and its animation finished.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Deactivate client-side event. Fires when a sub menu gets closed and its animation finished.

C#
public MenuEventBuilder Deactivate(string handler)
Parameters:handlerstring

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

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

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

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

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

Defines the handler of the Open client-side event. Fires before a sub menu gets opened. You can cancel this event to prevent opening the sub menu.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Open client-side event. Fires before a sub menu gets opened. You can cancel this event to prevent opening the sub menu.

C#
public MenuEventBuilder Open(string handler)
Parameters:handlerstring

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Select client-side event. Fires when a menu item gets selected.

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

The handler code wrapped in a text tag.

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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

Defines the handler of the Select client-side event. Fires when a menu item gets selected.

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

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

Returns:

MenuEventBuilder

Returns the current instance of MenuEventBuilder .

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