Data from RadGrid will be filtered when Filter RadButton is clicked

2 posts, 0 answers
  1. Yana
    Yana avatar
    32 posts
    Member since:
    Aug 2011

    Posted 22 Aug 2011 Link to this post

    Hi Guys,

    I'd like to know how to show up a context menu on a RadButton, and then the data then will be filtered/grouped/sorted from the RadGrid.

    Here is the context menu that I wanted to have on a RadButton when it is clicked:

  2. Dimitrina
    Dimitrina avatar
    3769 posts

    Posted 25 Aug 2011 Link to this post

    Hello Yana,

     You may show a ContextMenu when you click on a RadButton like so:

    if (grid != null)
                    // create menu
                    RadContextMenu contextMenu = new RadContextMenu();
                    // set menu Theme
                    StyleManager.SetTheme(contextMenu, StyleManager.GetTheme(grid));
                    contextMenu.Opened += OnMenuOpened;
                    contextMenu.ItemClick += OnMenuItemClick;
                    RadContextMenu.SetContextMenu(grid, contextMenu);

    Then in the onMenuItemClick event you will need to implement the logic for filtering, grouping and sorting. You may see a sample implementation of this functionality at our online demo about HeaderContextMenu . All WPF examples are available in our installation files and you can see them working here. If you download the WPF demos, then just navigate to the GridView/HeaderContextMenu example.

    There, in the left section, you will see a sample source code shown under the file GridViewHeaderMenu.cs. If you would like to get the full project then you could find it in the Demos folder inside your package of the RadControls.

    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  3. DevCraft banner
Back to Top