How to disable three of the four menu items from the Docking Manager Context Menu

Hi,

We are using a Docking Manager as implemented in the SDI Demo.

When we right click on the Docking Manager panel, we get the following four context menu items:

Hide
Floating
DockTo
AutoHide

The point is: We do not need the last theree Context Menu items , namely Floating,DockTo and AutoHide.However, we do need the Hide ContextMenu with the associated functionality.How do we go about this?

Any suggestion would be greatly appreciated.

Thanks & Regards,
Himanshu

2 Replies

GS Gopalakrishnan S Syncfusion Team January 30, 2007 09:05 PM UTC

Hi Himanshu,

Thanks for using Syncfusion products.

You can use DockContextMenu event of docking manager for hiding the ContextMenu items.

Here is the code snippet:

this.dockingManager1.DockContextMenu += new Syncfusion.Windows.Forms.Tools.DockContextMenuEventHandler(this.dockingManager1_DockContextMenu);

private void dockingManager1_DockContextMenu(object sender, DockContextMenuEventArgs arg)
{
arg.ContextMenu.ParentBarItem.Items[0].Visible = false;
arg.ContextMenu.ParentBarItem.Items[1].Visible = false;
arg.ContextMenu.ParentBarItem.Items[2].Visible = false;
arg.ContextMenu.ParentBarItem.Items[3].Visible = false;
}


Please let me know if this helps.

Regards,
S.Gopal.


HI Himanshu January 31, 2007 01:15 PM UTC

Hi Gopal,

Thanks for the prompt reply.

Yes it worked exactly as desired.

Thanks again for the assistance.

Regards,
Himanshu


Loader.
Up arrow icon