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

Defines the fluent API for configuring GridContextMenu

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridContextMenuBuilder

Inheritance: objectGridContextMenuBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public GridContextMenuBuilder(GridContextMenuSettings container)
Parameters:containerGridContextMenuSettings

Properties

C#
protected GridContextMenuSettings Container { get; }

Methods

Configures the context menu commands for the grid body (data rows).

C#
public GridContextMenuBuilder Body(Action<GridContextMenuCommandFactory> configurator)
Parameters:configuratorAction<GridContextMenuCommandFactory>

The lambda which configures the body context menu commands.

Returns:

GridContextMenuBuilder

Sets the event configuration of the grid context menu.

C#
public GridContextMenuBuilder Events(Action<GridContextMenuEventBuilder> configurator)
Parameters:configuratorAction<GridContextMenuEventBuilder>

The lambda which configures the events

Returns:

GridContextMenuBuilder

Example:
C#
@(Html.Kendo().Grid&lt;Product&gt;()
.Name("grid")
.DataSource(dataSource =&gt;
// configure the data source
dataSource
.Ajax()
.Read(read =&gt; read.Action("Products_Read", "Home"))
)
.CcontextMenu(menu =&gt; menu
.Events(events =&gt; events.Open("open"))
)
)
&lt;script&gt;
function open(e) {
// handle the dataBound event
}
&lt;/script&gt;

Configures the context menu commands for the grid groups (group rows).

C#
public GridContextMenuBuilder Groups(Action<GridContextMenuCommandFactory> configurator)
Parameters:configuratorAction<GridContextMenuCommandFactory>

The lambda which configures the group context menu commands.

Returns:

GridContextMenuBuilder

Configures the context menu commands for the grid header.

C#
public GridContextMenuBuilder Head(Action<GridContextMenuCommandFactory> configurator)
Parameters:configuratorAction<GridContextMenuCommandFactory>

The lambda which configures the header context menu commands.

Returns:

GridContextMenuBuilder