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

Data from RadGrid will be filtered when Filter RadButton is clicked

1 Answer 30 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Yana
Top achievements
Rank 1
Yana asked on 23 Aug 2011, 02:50 AM
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: http://www2.picturepush.com/photo/a/6379460/img/6379460.png


Thanks

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 Aug 2011, 05:01 PM
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.

Regards,
Didie
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 >>

Tags
Buttons
Asked by
Yana
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or