Home Unanswered Active Tags New Question

Dynamically adding a DayPilotMenu

Is there a way to do this.

I need a different menu for each item.

Or is there a way to use the event bubble as some sort off menu per item.

Asked by neokglitch 3 years ago.
Replies

I created this but it is not working:

DayPilotMenu menu = new DayPilotMenu();
menu.ID = "CustomMenu1";
MenuItem item = new MenuItem();
item.Text = "Edit...";
item.Action = MenuItemAction.NavigateUrl;
item.NavigateUrl = "test.aspx?id={{0}}";
item.NavigateUrlTarget = "_blank";
menu.MenuItems.Add(item);
DayPilotCalendar1.Controls.Add(menu);

Comment posted by neokglitch 3 years ago.

It's possible to have several menu types and assign them to events in BeforeEventRender (e.ContextMenuClientName set to the value of DayPilotMenu.ClientObjectName).

But if you really need item-specific text you should use the bubble.

Comment posted by Dan Letecky 3 years ago.

Ok i am using the Bubble but how do i get the Start and End from the event.

Comment posted by neokglitch 3 years ago.

At this moment, only the event id (PK) is sent to the bubble RenderContent event. You should load other data from the DB.

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

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