# Appointment Context Menu

With Q3 2009, RadScheduler gives you the option to enable a default appointment context menu.

If **AppointmentContextMenuSettings**-**EnableDefault** is set to **true**, right-clicking on an appointment will display a default context menu with two action items - **Edit** and **Delete**. The default appointment context menu is disabled by default.

You can use the AppointmentContextMenuSettings to also style the menu through a [skin registration](https://www.telerik.com/products/aspnet-ajax/documentation/styling/controlling-visual-appearance/skin-registration), or to [disable its embedded resources](https://www.telerik.com/products/aspnet-ajax/documentation/getting-started/performance/disabling-embedded-resources):

![appointment context menu settings](https://www.telerik.com/products/aspnet-ajax/documentation/assets/1a4b5c35a5d1a17cbd277c7f3d447b2b/scheduler_appointmentcontextmenusettings.png)

If not specified, the above settings will be inherited from those of the RadScheduler instance.

![appointment context menu](https://www.telerik.com/products/aspnet-ajax/documentation/assets/663a9d46139acdc667b2ed5b8f0bf2ec/scheduler_appointmentcontextmenu.png)

The default appointment context menu can be customized declaratively:

```ASP.NET
<telerik:RadScheduler RenderMode="Lightweight" ID="RadScheduler1" runat="server">
   <AppointmentContextMenus>
	   <telerik:RadSchedulerContextMenu runat="server" ID="ContextMenu1">
		   <Items>
			   <telerik:RadMenuItem Text="Open" Value="CommandEdit" />
			   <telerik:RadMenuItem IsSeparator="True" />
			   <telerik:RadMenuItem Text="Categorize">
				   <Items>
					   <telerik:RadMenuItem Text="Development" Value="1" />
					   <telerik:RadMenuItem Text="Marketing" Value="2" />
					   <telerik:RadMenuItem Text="Personal" Value="3" />
					   <telerik:RadMenuItem Text="Work" Value="4" />
				   </Items>
			   </telerik:RadMenuItem>
			   <telerik:RadMenuItem IsSeparator="True" />
			   <telerik:RadMenuItem Text="Delete" Value="CommandDelete" />
		   </Items>
	   </telerik:RadSchedulerContextMenu>
   </AppointmentContextMenus>
</telerik:RadScheduler>      
	
```

![appointment context menu customized](https://www.telerik.com/products/aspnet-ajax/documentation/assets/187f2d673d15c98c140ad88eeba7cc58/scheduler_appointmentcontextmenucustomized.png)

The functionality of the default menu items can be achieved by setting the **Value** property of the menu item to a command name.RadScheduler's appointment context menu will recognize the following commands:

* CommandEdit

* CommandDelete

To allow associating other functionality to a menu item, RadScheduler exposes the following events:

**Client Side**

* [OnClientAppointmentContextMenuItemClicking](https://www.telerik.com/products/aspnet-ajax/documentation/controls/scheduler/client-side-programming/events/onclientappointmentcontextmenuitemclicking)

* [OnClientAppointmentContextMenuItemClicked](https://www.telerik.com/products/aspnet-ajax/documentation/controls/scheduler/client-side-programming/events/onclientappointmentcontextmenuitemclicked)

**Server Side**

* [OnAppointmentContextMenuItemClicking](https://www.telerik.com/products/aspnet-ajax/documentation/controls/scheduler/server-side-programming/server-events/appointmentcontextmenuitemclicking)

* [OnAppointmentContextMenuItemClicked](https://www.telerik.com/products/aspnet-ajax/documentation/controls/scheduler/server-side-programming/server-events/appointmentcontextmenuitemclicked-)

For more information, please see the [Context menu](https://demos.telerik.com/aspnet-ajax/scheduler/examples/contextmenu/defaultcs.aspx) online demo.

If more than one appointment context menu is declared, you can specify which one to be opened for a specific appointmentvia the Appointment's **ContextMenuID** property. For example:

```C#
	
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
	e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenu2";
} 
	
```

```VB
Protected Sub RadScheduler1_AppointmentDataBound(ByVal sender As Object, ByVal e As SchedulerEventArgs)
	e.Appointment.ContextMenuID = "SchedulerAppointmentContextMenu2"
End Sub
		
```

If the RadScheduler is read-only (via the **ReadOnly** property) – then you will not be able to edit or delete appointments. This reflects on the context menu items too. The two options of the default appointment context menu will be disabled. Also if **AllowEdit** or **AllowDelete** properties of the RadScheduler are set to **“False”** – the corresponding menu item will be disabled.

The picture below demonstrates disabled **“Edit”** item as the **AllowEdit** property of the RadScheduler is set to **“False”**:

![RadScheduler Appointment Contextmenu Customized](https://www.telerik.com/products/aspnet-ajax/documentation/assets/bc5a1f5222ac3397305138926331679f/scheduler_appointmentcontextmenucustomized1.png)
