Home Unanswered Active Tags New Question

DP Month and Context Menu applied in BeforeEventRender

DP v 5.7.1904, FF3.0.14, IE 8.0.6001, using DayPilot Month

I'm trying to override the context menu on specific events in DayPilot Month. I've tried using the following, but it results in no DayPilot menu (and a browsercontext menu).

protected void DayPilotMonth1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Month.BeforeEventRenderEventArgs e)
{
e.ContextMenuClientName = "emptyMenu";
}

<DayPilot:DayPilotMenu ID="emptyMenu" runat="server">
<DayPilot:MenuItem Text="You may not edit this event" Action="PostBack" Command="noEvent"></DayPilot:MenuItem>
</DayPilot:DayPilotMenu>

The "noEvent" command is properly handled in DPMonth_EventMenuClick.

Suggestions?

Thanks!

Asked by Anonymous 2 years ago.
Replies

You should specify ClientObjectName of the DayPilotMenu control and use the same value in the BeforeEventRender. When you don't specify ClientObjectName property, the ClientID value is used for the client-side object. On a plain page, it is the same as ID but when you use master pages or .ascx file it includes the IDs of the parent controls, e.g. ctl00_ContentPlaceHolder1_DayPilotMenu2 instead of just DayPilotMenu2.

Comment posted by Dan Letecky 2 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java