# ContextMenuEventBuilder

## Methods

### Close(System.String)

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

For more information see [Close](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/close) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.Close("onClose"))
            )
             
```

### Close(System.Func)

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

For more information see [Close](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/close) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.Close(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### DataBound(System.String)

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

For more information see [DataBound](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/databound) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.DataBound("onDataBound"))
            )
             
```

### DataBound(System.Func)

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

For more information see [DataBound](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/databound) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.DataBound(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Open(System.String)

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

For more information see [Open](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/open) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.Open("onOpen"))
            )
             
```

### Open(System.Func)

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

For more information see [Open](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/open) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.Open(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Activate(System.String)

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

For more information see [Activate](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/activate) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.Activate("onActivate"))
            )
             
```

### Activate(System.Func)

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

For more information see [Activate](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/activate) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.Activate(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Deactivate(System.String)

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

For more information see [Deactivate](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/deactivate) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.Deactivate("onDeactivate"))
            )
             
```

### Deactivate(System.Func)

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

For more information see [Deactivate](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/deactivate) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.Deactivate(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```

### Select(System.String)

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

For more information see [Select](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/select) event.

#### Parameters

##### handler - `System.String`

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

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                        .Name("ContextMenu")
                        .Events(events => events.Select("onSelect"))
            )
             
```

### Select(System.Func)

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

For more information see [Select](https://docs.telerik.com/kendo-ui/api/ui/contextmenu/events/select) event.

#### Parameters

##### handler - `System.Func<Object,Object>`

The handler code wrapped in a text tag.

#### RETURNS

Returns the current instance of [ContextMenuEventBuilder](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/contextmenueventbuilder) .

#### Example

```
 
             @( Html.Kendo().ContextMenu()
                       .Name("ContextMenu")
                       .Events(events => events.Select(
                            @<text>
                            function(e) {
                                //event handling code
                            }
                            </text>
                       ))
            )
             
```
