search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

DP Month and Context Menu applied in BeforeEventRender

Asked by Anonymous
10 years ago.

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!

Comment posted by Dan Letecky
10 years ago.

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.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.