It is possible to assign a different menu to each event using the BeforeEventRender event handler.
You need to create a special DayPilotMenu control for each menu type you want to use:
<daypilot:daypilotmenu id="DayPilotMenu1" runat="server" ClientObjectName=""> <DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="window.location.href='Edit.aspx?id=' + e.value();" ></DayPilot:MenuItem> <DayPilot:MenuItem Text="Send" Action="JavaScript" JavaScript="alert('Sending event (id {0})');" ></DayPilot:MenuItem> <DayPilot:MenuItem Text="-" Action="NavigateUrl" ></DayPilot:MenuItem> <DayPilot:MenuItem Text="Delete (CallBack)" Action="CallBack" Command="Delete"></DayPilot:MenuItem> <DayPilot:MenuItem Action="PostBack" Command="Delete" Text="Delete (PostBack)" /> <DayPilot:MenuItem Text="Delete (JavaScript using callback)" Action="JavaScript" Command='Delete' JavaScript="if (confirm('Do you really want to delete event ' + e.text() + ' ?')) ctl00_ContentPlaceHolder1_DayPilotCalendar1.eventMenuClickCallBack(e, command);"></DayPilot:MenuItem> </daypilot:daypilotmenu> <daypilot:daypilotmenu id="Daypilotmenu2" runat="server" ClientObjectName="specialmenu" ShowMenuTitle="False"> <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Opening event (id {0})');" Text="Open" /> <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Sending event (id {0})');" Text="Send" /> <DayPilot:MenuItem Action="NavigateUrl" Text="-" /> <DayPilot:MenuItem Action="JavaScript" Command='Delete' JavaScript="if (confirm('Do you really want to delete event ' + e.text() + ' ?')) ctl00_ContentPlaceHolder1_DayPilotCalendar1.eventMenuClickCallBack(e, command);" Text="Delete (JavaScript using callback)" /> </DayPilot:DayPilotMenu>
You can assign a global (per-control) context menu using ContextMenuID property:
ContextMenuID="DayPilotMenu1"
You can assign a custom (per-event) context menu in BeforeEventRender event handler:
protected void DayPilotCalendar1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e) { if (e.Value == "4") { e.InnerHTML = "This event has a special context menu"; e.DurationBarColor = "red"; e.ContextMenuClientName = "specialmenu"; } }
See also Demo/Calendar/ContextMenu.aspx in the DayPilot package.