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

Defines the fluent interface for configuring ColumnMenu.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class GridColumnMenuSettingsBuilder

Inheritance: objectGridColumnMenuSettingsBuilder

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

Constructors

Initializes a new instance of the GridColumnMenuSettings class.

C#
public GridColumnMenuSettingsBuilder(GridColumnMenuSettings settings)
Parameters:settingsGridColumnMenuSettings

The settings.

Methods

Specifies the adaptive rendering of the component.

C#
public GridColumnMenuSettingsBuilder AdaptiveMode(AdaptiveMode value)
Parameters:valueAdaptiveMode

The value for AdaptiveMode

Returns:

GridColumnMenuSettingsBuilder

If set to 'true', the column menu would allow the user to fit one or all columns to the width of their content. This setting is available only when the tabbed componentType is used.

C#
public GridColumnMenuSettingsBuilder AutoSize()
Returns:

GridColumnMenuSettingsBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu => menu.ComponentType("tabbed").AutoSize())
)

If set to 'true', the column menu would allow the user to fit one or all columns to the width of their content. This setting is available only when the tabbed componentType is used.

C#
public GridColumnMenuSettingsBuilder AutoSize(bool value)
Parameters:valuebool

The value for AutoSize

Returns:

GridColumnMenuSettingsBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu => menu.ComponentType("tabbed").AutoSize((bool)ViewData["autoSize"]))
)

If set to 'true', the global column menu will render a button to allow the user to clear all filters applied to the grid.

C#
public GridColumnMenuSettingsBuilder ClearAllFilters()
Returns:

GridColumnMenuSettingsBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu => menu.ClearAllFilters())
)

If set to 'true', the global column menu will render a button to allow the user to clear all filters applied to the grid.

C#
public GridColumnMenuSettingsBuilder ClearAllFilters(bool value)
Parameters:valuebool

The value for ClearAllFilters

Returns:

GridColumnMenuSettingsBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu => menu.ClearAllFilters(true))
)

If set to 'true', the column menu would allow the user to select (show and hide) grid columns. By default, the column menu allows column selection.

C#
public GridColumnMenuSettingsBuilder Columns(Action<GridColumnMenuColumnsSettingsBuilder> configurator)
Parameters:configuratorAction<GridColumnMenuColumnsSettingsBuilder>

The configurator for the columns setting.

Returns:

GridColumnMenuSettingsBuilder

Enables/disables columns section in header column menu.

C#
public GridColumnMenuSettingsBuilder Columns(bool value)
Parameters:valuebool

If true, enables the columns section in the column menu

Returns:

GridColumnMenuSettingsBuilder

The Enabled method is useful when you need to enable/disable columns section in column menu based on certain conditions.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu =&gt; menu.Columns((bool)ViewData["enableColumns"]))
)

Specifies the component type of the column menu. "classic" - Uses the standard rendering of the column menu.; "modern" - Uses new rendering with a fresh and modern look and feel. or "tabbed" - Uses the rendering of the "modern" menu, but splits its content into different tabs..

C#
public GridColumnMenuSettingsBuilder ComponentType(string value)
Parameters:valuestring

The value for ComponentType

Returns:

GridColumnMenuSettingsBuilder

Enables/disables header column menu.

C#
public GridColumnMenuSettingsBuilder Enabled(bool value)
Parameters:valuebool

If true, enables the ColumnMenu.

Returns:

GridColumnMenuSettingsBuilder

The Enabled method is useful when you need to enable column menu based on certain conditions.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu =&gt; menu.Enabled((bool)ViewData["enableColumnMenu"]))
)

Enables/disables filter section in header column menu.

C#
public GridColumnMenuSettingsBuilder Filterable(bool value)
Parameters:valuebool

If true, enables filtering.

Returns:

GridColumnMenuSettingsBuilder

The Enabled method is useful when you need to enable/disable filter section in column menu based on certain conditions.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu =&gt; menu.Filterable((bool)ViewData["enableFilter"]))
)

Enables you to define custom messages in grid column menu.

C#
public GridColumnMenuSettingsBuilder Messages(Action<ColumnMenuMessagesBuilder> configurator)
Parameters:configuratorAction<ColumnMenuMessagesBuilder>Returns:

GridColumnMenuSettingsBuilder

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu =&gt; menu.Messages(msg =&gt; msg.Filter("Custom filter message")))
)

Enables/disables sort section in header column menu.

C#
public GridColumnMenuSettingsBuilder Sortable(bool value)
Parameters:valuebool

If true, enables sorting.

Returns:

GridColumnMenuSettingsBuilder

The Enabled method is useful when you need to enable/disable sort section in column menu based on certain conditions.

Example:
C#
@(Html.Kendo().Grid(Model)
.Name("Grid")
.ColumnMenu(menu =&gt; menu.Sortable((bool)ViewData["enableSort"]))
)