An activated time range selection can display a context menu on right click.
ASP.NET WebForms
<DayPilot:DayPilotCalendar runat="server" id="DayPilotCalendar1" ... ClientObjectName="dpc" ContextMenuSelectionID="DayPilotMenuSelection" /> <DayPilot:DayPilotMenu ID="DayPilotMenuSelection" runat="server" CssClassPrefix="menu_default" > <DayPilot:MenuItem Action="JavaScript" JavaScript="dpc.timeRangeSelectedCallBack(e.start, e.end, e.resource);" Text="Create new event (JavaScript)" /> <DayPilot:MenuItem Action="PostBack" Command="Insert" Text="Create new event (PostBack)" /> <DayPilot:MenuItem Action="CallBack" Command="Insert" Text="Create new event (CallBack)" /> <DayPilot:MenuItem Text="-" Action="JavaScript"></DayPilot:MenuItem> <DayPilot:MenuItem Action="JavaScript" JavaScript="alert('Start: ' + e.start + '\nEnd: ' + e.end + '\nResource id: ' + e.resource);" Text="Show selection details" /> <DayPilot:MenuItem Action="JavaScript" JavaScript="dpc.clearSelection();" Text="Clean selection" /> </DayPilot:DayPilotMenu>
ASP.NET MVC
@Html.DayPilotMenu("menu_selection", new DayPilotMenuConfig { Items = new DayPilot.Web.Mvc.MenuItemCollection { new DayPilot.Web.Mvc.MenuItem { Text = "Open", Action = MenuItemAction.JavaScript, JavaScript = "alert(e.start + ' ' + e.end + ' ' + e.resource);"} } }) @Html.DayPilotCalendar("dpc", new DayPilotCalendarConfig { BackendUrl = ResolveUrl("~/Calendar/Backend"), ContextMenuSelection = "menu_selection", })