How to disable the right click function where...
you mouse over your mouse to the pageview(DocumentWindow) Tab... right click.
you will see the close, close all...
May i know how to disable this function of right click?
Regards
Johnny
1 Answer, 1 is accepted
0
Stefan
Telerik team
answered on 10 May 2011, 04:59 PM
Hi Johnny,
Thank you for writing.
RadPageView does not have a context menu on its page items by default. I guess that you are talking about the tabs of the DocumentWindows of RadDock. If this is your case, you can remove the context menu from them by setting the AllowDocumentContextMenu property of the ContextMenuService to false:
So, I want to custom text of context menu then how to do it? For example: Close --> Close me or Close All --> Close All Tabs
Thank you so much
Dinko | Tech Support Engineer
Telerik team
commented on 02 Feb 2024, 11:00 AM
Hi Nhan,
You can use a similar approach as demonstrated in the article mentioned in Stefan's reply. In a few words, you can get the RadMenuItemBase object in the ContextMenuDisplaying and modify the text property.
privatevoidmenuService_ContextMenuDisplaying(object sender, ContextMenuDisplayingEventArgs e)
{
//the menu request is associated with a valid DockWindow instance, which resides within a DocumentTabStripif (e.MenuType == ContextMenuType.DockWindow &&
e.DockWindow.DockTabStrip is DocumentTabStrip)
{
//remove the "Close" menu itemsfor (int i = 0; i < e.MenuItems.Count; i++)
{
RadMenuItemBase menuItem = e.MenuItems[i];
if (menuItem.Name == "CloseWindow")
{
menuItem.Text = "Close me";
}
if (menuItem.Name == "CloseAll")
{
menuItem.Text = "Close All Tabs";
}
}
}
}