Skip to main content
A newer version of this page is available.

PreparePopupMenuEventArgs(SchedulerPopupMenu) Constructor

Initializes a new instance of the PreparePopupMenuEventArgs class with the specified settings.

Namespace: DevExpress.XtraScheduler

Assembly: DevExpress.XtraScheduler.v19.2.dll

Declaration

public PreparePopupMenuEventArgs(
    SchedulerPopupMenu menu
)

Parameters

Name Type Description
menu SchedulerPopupMenu

A SchedulerPopupMenu object which represents a popup menu.

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);
    }
}
See Also