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

Grid Header Context Menu

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 1
Robin asked on 03 Aug 2012, 08:49 AM
Hello,

I would like to have a Context Menu for a Header of a RadGrid that consists of the "Columns" part of the normal Context Menu and some other options I'd like to add myself (the Menu should not have the other normal Options like "Sort Ascending" visible).
Is there an easy way to achieve that functionality for the Context Menu of the Header, or is there an easy way to implement Check Boxes for the Menu Items of the Context Menu control to look familiar to the "Columns" part of the Header Context Menu of the Rad Grid control?

Thank you very much in advance,
Robin

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 06 Aug 2012, 02:22 PM
Hello Robin,

I believe it will be very helpful if you check out the following thread where the requested functionality is discussed:
 Customize Header Context Menu

An alternative approach would be to use the HeaderMenuShowing client side event and configure the menu per your requirements as demonstrated in the demo below:
 
<ClientEvents ... OnHeaderMenuShowing="headerMenuShowing">
 JavaScript:
function headerMenuShowing(sender, args) {
    var menu = args.get_menu();
    menu.get_items().clear();
    var newItem = new Telerik.Web.UI.RadMenuItem();
    newItem.set_text("Clicked: " + args.get_gridColumn().get_uniqueName());
    menu.get_items().add(newItem);
}

Menu / Add/Remove/Disable Items

I hope this will prove helpful.

Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Robin
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or