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

Same context menu in all pages

2 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sam
Top achievements
Rank 1
sam asked on 17 Jul 2010, 11:10 PM
Hello all,
I have many pages and in all am using RagGrid and contextmenu
is there any way to use the same contextmenu  or to inherit from ?

i need to use my code in all pages
protected override void OnPreRenderComplete(EventArgs e)
{
    base.OnPreRenderComplete(e);
    RadMenuItem item =  RadGrid1.HeaderContextMenu.FindItemByValue("GroupBy");
    RadGrid1.HeaderContextMenu.Items.RemoveAt(0);
    RadGrid1.HeaderContextMenu.Items.Remove(item);
    item = RadGrid1.HeaderContextMenu.FindItemByValue("UnGroupBy");
    RadGrid1.HeaderContextMenu.Items.Remove(item);
}
 any help will be appreciated

2 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 22 Jul 2010, 08:00 AM
Hello sam,

The Group by and the Ungroup items in the context menu should not appear if RadGrid grouping is not enabled. However if it is, and you want to remove them, you will need to add the preceding code on each separate page.

Regards,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sam
Top achievements
Rank 1
answered on 23 Jul 2010, 08:02 AM
Ok thank you very much i wanted to use it as a user control
but sounds your solution is the one
Tags
Grid
Asked by
sam
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
sam
Top achievements
Rank 1
Share this question
or