Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SchedulerPopupMenu Class

Represents a popup (context) menu of the Scheduler.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v24.2.dll

NuGet Package: DevExpress.Win.Scheduler

#Declaration

public class SchedulerPopupMenu :
    CommandPopupMenu<SchedulerMenuItemId>

#Remarks

SchedulerPopupMenu objects are used to represent a context menu which is usually displayed when a user right-clicks a SchedulerControl. Popup menu items depend on the area of the Scheduler which was clicked, however, it’s also possible to customize these items on the SchedulerControl.PopupMenuShowing event.

Note

The list of standard and check menu items used in the Scheduler is represented by SchedulerMenuItemId enumeration members.

#Example

This example demonstrates how to customize the SchedulerControl‘s popup menus (the SchedulerMenuItemId.DefaultMenu in this case). To change particular items in a popup menu handle the SchedulerControl.PopupMenuShowing event of a Scheduler Control.

using DevExpress.XtraScheduler;
// ...

private void schedulerControl1_PopupMenuShowing(object sender, PopupMenuShowingEventArgs e)

    // Check if it's the default menu of a Scheduler.
    if (e.Menu.Id == SchedulerMenuItemId.DefaultMenu)
    {

        // Disable the "New Recurring Appointment" menu item.
        e.Menu.DisableMenuItem(SchedulerMenuItemId.NewRecurringAppointment);

        // Hide the "New Recurring Event" menu item.
        e.Menu.RemoveMenuItem(SchedulerMenuItemId.NewRecurringEvent);

        // Enable the "Go To Today" menu item.
        e.Menu.EnableMenuItem(SchedulerMenuItemId.GotoToday);

        // Find the "New Appointment" menu item and rename it.
        SchedulerMenuItem item = e.Menu.GetMenuItemById(SchedulerMenuItemId.NewAppointment);
        if (item != null) item.Caption = "&New Event";
    }
    // Check if it's the appointment menu.
    if(e.Menu.Id == SchedulerMenuItemId.AppointmentMenu) {
      e.Menu.RemoveMenuItem(SchedulerMenuItemId.LabelSubMenu);
      e.Menu.RemoveMenuItem(SchedulerMenuItemId.StatusSubMenu);
    }
}

#Implements

See Also