How to: Customize the Popup Menu
- 2 minutes to read
#Customize the Popup Menu at Runtime
This example demonstrates how to customize the SchedulerControl popup menu at runtime. In particular, this sample demonstrates how to remove the default New Recurring Appointment menu item from the Default Popup Menu, and add a custom item instead.
For this, it is necessary to handle the SchedulerControl.PopupMenuShowing event. In this event handler, use the SchedulerMenuEventArgs.Menu property to check whether the event has been raised for the default popup menu and change the SchedulerMenuEventArgs.Customizations collection to modify a list of popup menu items.
#Customize the Popup Menu at Design Time
The SchedulerControl provides special properties that allow you to customize its context menus by adding new menu items or removing existing items. These properties return a BarManagerActionCollection object that provides multiple methods, used to manage menu items contained within a popup menu.
Menu Type | Description | Image | Property |
---|---|---|---|
Default Popup Menu | This menu is shown when an end-user right-clicks time cells that do not contain any appointments. | ![]() |
Scheduler |
Appointment Popup Menu | This menu is shown when an end-user right-clicks an appointment. | ![]() |
Scheduler |
Time Ruler Popup Menu | This menu is shown when an end-user right-clicks an time ruler. | ![]() |
Scheduler |
Default Menu Item Names
When customizing popup menus (e.g., removing or moving default items), these menus and menu items are referred to by their names listed in SchedulerMenuItemName.
Adding and Moving Menu Items
This example demonstrates how to add custom menu items to the Appointment Popup Menu of the SchedulerControl via the SchedulerControl.AppointmentMenuCustomizations property.
Removing Menu Items
This example demonstrates how to remove a specific item from the Default Popup Menu of the SchedulerControl via the SchedulerControl.DefaultMenuCustomizations property.