A newer version of this page is available. Switch to the current version.

ASPxScheduler.PreparePopupMenu Event

Obsolete. Occurs before a context menu is created for a scheduler.

Namespace: DevExpress.Web.ASPxScheduler

Assembly: DevExpress.Web.ASPxScheduler.v18.2.dll


[Obsolete("You should use the 'PopupMenuShowing' instead", false)]
public event PreparePopupMenuEventHandler PreparePopupMenu
<Obsolete("You should use the 'PopupMenuShowing' instead", False)>
Public Event PreparePopupMenu As PreparePopupMenuEventHandler

Event Data

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

Property Description
Menu Gets or sets 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.


A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E291.


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