Skip to main content

ASPxScheduler.PreparePopupMenu Event


You should use the 'PopupMenuShowing' instead

Occurs before a context menu is created for a scheduler.

Namespace: DevExpress.Web.ASPxScheduler

Assembly: DevExpress.Web.ASPxScheduler.v23.1.dll

NuGet Package: DevExpress.Web.Scheduler


[Obsolete("You should use the 'PopupMenuShowing' instead", false)]
public event PreparePopupMenuEventHandler PreparePopupMenu

Event Data

The PreparePopupMenu event's data class is PreparePopupMenuEventArgs. The following properties provide information specific to this event:

Property Description
Menu Gets the popup menu for which this event was raised. Inherited from PopupMenuShowingEventArgs.


Handle the PreparePopupMenu event to modify items in the context menu. The current context menu can be accessed via the PopupMenuShowingEventArgs.Menu property.


The following example illustrates how to handle the PreparePopupMenu event for customizing a context menu.

protected void ASPxScheduler1_PreparePopupMenu(object sender, 
    PreparePopupMenuEventArgs e)
    ASPxSchedulerPopupMenu menu = e.Menu;
    DevExpress.Web.MenuItemCollection menuItems = menu.Items;
    // Check whether this menu is invoked by clicking empty time cells
    if (menu.Id == SchedulerMenuItemId.DefaultMenu) {
        // Remove the "New Appointment" item
        DevExpress.Web.MenuItem item = menuItems.FindByName("NewAppointment");
        if(item != null) menuItems.Remove(item);

        // Create a group and add two submenus
        DevExpress.Web.MenuItem newItem = 
            new DevExpress.Web.MenuItem("CreateNewEvent", "TemplateEvents");
        newItem.BeginGroup = true;
        menuItems.Insert(0, newItem);
        newItem.Items.Add(new DevExpress.Web.MenuItem("Check engine oil", 
        newItem.Items.Add(new DevExpress.Web.MenuItem("Wash the car", 
See Also