We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Limiting context menu options

Thread ID:





128502 Jan 26,2017 12:00 AM UTC Jan 26,2017 07:39 AM UTC WinForms 1
Tags: ScheduleControl
Chris Iverson
Asked On January 26, 2017 12:00 AM UTC


In the scheduler control I want to limit the context menu to just a few items.

Specifically I only want the options for

Month view
Week view

Could you provide a sample that gives only those options or for a custom menu that will only allow those options


Mohanraj Gunasekaran [Syncfusion]
Replied On January 26, 2017 07:39 AM UTC

Hi Chris, 

Thanks for using Syncfusion products. 

In order to set the custom context menu for MonthView and WekView in ScheduleControl , you can use the ContextMenuStrip property, ScheduleAppontMentClick event and SetUpContextMenu event to handle the context menu. Please refer the below code snippet and refer the below attached sample 

Code snippet 
ScheduleGrid grid; 
ContextMenuStrip contextMenu; 
grid = this.scheduleControl1.GetScheduleHost(); 
contextMenu = new System.Windows.Forms.ContextMenuStrip(); 
ToolStripItem item = new ToolStripMenuItem("Delete", (Image)(ScheduleGrid.GetBitmap("Delete.png")), new EventHandler(deleteItemClick)); 
grid.ContextMenuStrip = null; 
this.scheduleControl1.SetupContextMenu += scheduleControl1_SetupContextMenu; 
this.scheduleControl1.ScheduleAppointmentClick += scheduleControl1_ScheduleAppointmentClick; 
private void scheduleControl1_ScheduleAppointmentClick(object sender, ScheduleAppointmentClickEventArgs e) 
    if ((e.ClickType == ScheduleAppointmentClickType.RightClick) && (this.scheduleControl1.ScheduleType == ScheduleViewType.Month || this.scheduleControl1.ScheduleType == ScheduleViewType.Week)) 
        this.scheduleControl1.ContextMenuStrip = contextMenu; 

void scheduleControl1_SetupContextMenu(object sender, CancelEventArgs e) 
    if (this.scheduleControl1.ScheduleType == ScheduleViewType.Month || this.scheduleControl1.ScheduleType == ScheduleViewType.Week) 
        e.Cancel = true; 

Sample link: ScheduleControl 

Mohanraj G. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon