Column Menu item order

1 Answer 193 Views
Grid
Stefan
Top achievements
Rank 1
Iron
Stefan asked on 22 Oct 2021, 10:04 AM

Hi,

is it possible to change order of column menu items?

By default menu items are like this:
1. Sorting
2. Columns show/hide
3. Filtering

I would like to change that ordering to (for example):
1. Filter
2. Columns
3. Sort ascending
4. Sort descending

1 Answer, 1 is accepted

Sort by
0
Petar
Telerik team
answered on 26 Oct 2021, 01:15 PM

Hi Stefan,

The targeted functionality can be implemented using the columnMenuInit event of the Grid.

Here is a Dojo example demonstrating how you can change the order of the items inside the Grid column menu.

columnMenuInit: function(e){
   const menuItems = $(e.container[0]).find(".k-columnmenu-item-wrapper"); 
   $(menuItems[2]).before($(menuItems[0]));
   $(menuItems[1]).before($(menuItems[2]));
}

The same as demonstrated in the Dojo approach can be used in the context of the UI for ASP.NET Core. 

I hope the above example will help you achieve what you need in your application.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Stefan
Top achievements
Rank 1
Iron
Answers by
Petar
Telerik team
Share this question
or