HeaderContextMenu - replace entire menu with filter section?

2 posts, 0 answers
  1. Stuart Murray
    Stuart Murray avatar
    3 posts
    Member since:
    May 2007

    Posted 16 May Link to this post

    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.

  2. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 19 May Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top