This is a migrated thread and some comments may be shown as answers.

HeaderContextMenu - replace entire menu with filter section?

1 Answer 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
EBMS Stuart
Top achievements
Rank 1
EBMS Stuart asked on 16 May 2016, 06:37 AM

Hi,

I'm programmatically creating a grid on the server side, and would like to use the HeaderContextMenu to allow filtering (particularly, we're interested in the 2-step filtering provided in the menu). Because the other options are available elsewhere or are not used in our system, we'd like to have the context menu simply show the "filter" submenu. I can remove elements of the context menu using this code:

this.grid.HeaderContextMenu.ItemCreated += (ss, aa) =>
{
    if (aa.Item.Value == "FilterMenuParent" || (aa.Item.Parent is RadMenuItem && (aa.Item.Parent as RadMenuItem).Value == "FilterMenuParent"))
    {
    }
    else
    {
        aa.Item.Remove();
    }
};
However, everything I've tried to do in order to move the Filter Menu up to the top-level menu has failed.

In the attached image, the red-bordered menu is what we'd like to appear when right-clicking a column title.

Is there a way for me to do this? I've tried hooking into various menu events to replace the menu items with the filter menu, but it seems like it's not possible. The closest I can get so far is the top-level menu simply having the "Filter" option, which opens the Filter Menu. I'd like to skip that first step and just have the filter menu appear.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 19 May 2016, 07:02 AM
Hi Stuart,

I've already replied to your ticket with ID: 1035581. I suggest that we continue our conversation on the mentioned thread.

Regards,
Eyup
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
EBMS Stuart
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or