# Column Menu

The Grid column menu provides quick access to column operations such as sorting, filtering, and visibility.

Enable the column menu with the `ColumnMenu(true)` method. When enabled, each column header renders a menu that lets users sort, filter, or change column visibility. The menu also respects disabled operations in the column definition and does not render their related UI. For a runnable example, refer to the [Grid Column Menu demo](https://demos.telerik.com/aspnet-core/grid/column-menu).

> note
> Starting with R3 2022, you can disable the column menu for a specific column by using `.ColumnMenu(false)`.

## Global Column Menu

Starting with Telerik UI for ASP.NET Core R1 2024, you can display the column menu in the Grid [Toolbar](https://www.telerik.com/aspnet-core-ui/documentation/html-helpers/data-management/grid/toolbar) instead of in each column header. The global column menu lets you control column visibility and clear all Grid filters through a single button.

The following example shows how to set up the global column menu and enable the clear-all-filters button.

```Razor HtmlHelper
    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
        .Name("grid")
        .ToolBar(toolbar => toolbar.Columns())
        .ColumnMenu(menu =>
        {
            menu.ClearAllFilters(true);
        })
        ...
    )
```

```Razor TagHelper
    <kendo-grid name="grid">
        <toolbar>
        <toolbar-button name="columns"></toolbar-button></toolbar>
        <column-menu clear-all-filters="true"></column-menu>
        
    </kendo-grid>
```

For a runnable example with the global column menu, see the [Grid Global Column Menu demo](https://demos.telerik.com/aspnet-core/grid/toolbar-columns-menu).

## Column Reordering

Starting with Telerik UI for ASP.NET Core R2 SP1 2023, the Grid column menu provides options to change the target column position by using the **Move next** and **Move previous** buttons. This functionality requires enabled column reordering.

```Razor HtmlHelper
    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.OrderViewModel>()
        .Name("grid")
        .Reorderable(reorder => reorder.Columns(true))
    )
```

```Razor TagHelper
    <kendo-grid name="grid">
        <reorderable enabled="true" columns="true"/>
    </kendo-grid>
```

To see this functionality in action, check the [Grid Column Menu demo](https://demos.telerik.com/aspnet-core/grid/column-menu).

## Column Grouping

Starting with Telerik UI for ASP.NET Core R2 SP1 2023, the Grid column menu provides an option that lets users group or ungroup the Grid by the target column. To display this option in the column menu, enable grouping through the [`Groupable`](https://www.telerik.com/aspnet-core-ui/documentation/api/kendo.mvc.ui.fluent/gridbuilder#groupable) configuration.

## Column Title Sorting

The column menu allows you to control the visibility of each Grid column. For this purpose, the column menu renders a child column menu with a checkbox for each Grid column.
By default, the Grid column titles in the child column menu are not sorted. They have the same order as the columns in the Grid. To sort the column titles in the child menu, use the `ColumnMenu()` method.

The following example demonstrates how to sort the column titles in the child menu in ascending order:

```Razor HtmlHelper
    .ColumnMenu(menu=>
           menu.Columns(columns => columns.Sort("asc"))
    )
```

```Razor TagHelper
    <column-menu>
        <column-menu-columns sort="asc">

        </column-menu-columns>
    </column-menu>
```

## Column Title Grouping

The `ColumnMenu()` method accepts a `GridColumnMenuSettingsBuilder` that enables column grouping in the child menu. The `Columns()` group method expects a collection of model properties. The menu automatically uses Grid column titles when they are defined.

The following example demonstrates how to group columns by providing the model fields in a list of strings:

```Razor HtmlHelper
    .ColumnMenu(menu=>
           menu.Columns(columns => {
               columns.Groups(groups =>
               {
                   groups.Add().Title("Company Info").Columns(new List<string> { "CompanyName", "Country" });
                   groups.Add().Title("Contact Info").Columns(new List<string> { "ContactName", "ContactTitle" });
               });
           })
    )
```

```Razor TagHelper
    <column-menu>
        <column-menu-columns sort="asc">
            <column-menu-columns-groups>
                <column-menu-columns-group title="Company Info" columns='new string[] { "CompanyName", "Country" }' />
                <column-menu-columns-group title="Contact Info" columns='new string[] { "ContactName", "ContactTitle" }' />
            </column-menu-columns-groups>
        </column-menu-columns>
    </column-menu>
```

## Preventing Filter Popup Clipping

If a filter popup in the classic Column Menu clips the operator dropdown or date filter calendar, inspect the `.k-menu-popup` element for `overflow: auto`. This behavior was reported in version 2025.1.211. The following workaround was documented for that issue; verify it with your deployed version because later versions may not require the override.

```CSS
.k-menu-popup {
    overflow: visible !important;
}
```

For details, see the [classic Column Menu filter overflow issue](https://github.com/telerik/kendo-ui-core/issues/8140).

## Column Menu Types

The Telerik UI for ASP.NET Core Grid provides the following Column Menu component types:

| Column Menu Type | Description                                                                                                                                                                                                                                                     |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `classic`        | The default rendering mode of the Grid's Column Menu                                                                                                                                                                                                            |
| `modern`         | Introduced with R1 2021 version of the Telerik UI for ASP.NET Core suite. The `modern` rendering mode aims to deliver a fresh look and feel to the Grid's Column Menu                                                                                           |
| `tabbed`         | Introduced with R3 SP1 2023 version of the Telerik UI for ASP.NET Core suite. The `tabbed` component type delivers a more compact view without sacrificing the available space. The tabbed interface provides a neat way to organize items into related groups. |

By default, the column menu of the Grid is initialized in the `classic` render mode. To set it to `modern` or `tabbed`, configure the `ColumnMenu.ComponentType` option of the Telerik UI for ASP.NET Core Grid as demonstrated below:

```Razor HtmlHelper
    @(Html.Kendo().Grid()
            .Name("grid")
            .ColumnMenu(m=>{
               m.ComponentType("tabbed");
            })
    )
```

```Razor TagHelper
<kendo-grid name="grid">
    <column-menu component-type="tabbed">

    </column-menu>
</kendo-grid>
```

## See Also

* [ASP.NET Core DataGrid Homepage](https://www.telerik.com/aspnet-core-ui/grid)

* [Column Menu by the Grid (Demo)](https://demos.telerik.com/aspnet-core/grid/column-menu)
