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

Can I show a context menu when the user right-clicks on an open space in the Scheduler?

Asked by Scott Mitchell
10 years ago.

I am using the ASP.NET MVC Scheduler. Currently, I have a context menu opening whenever a user right-clicks on an event, with options to edit or delete the event. But I need to be able to let the user right-click on an open space in the Scheduler to show a context menu that let's them choose what type of event to add to the schedule.

Is it possible to show a context menu when the user right-clicks on an empty space in the Scheduler? I know I can do it when they left-click via TimeRangeSelectedHandling, but I am wondering if it's possible to do this via a right-click, instead.

Thanks!

Answer posted by Dan Letecky [DayPilot]
10 years ago.

Yes, this is possible - you need to assign the context menu to ContextMenuSelection:

<%= Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig {
  BackendUrl = ResolveUrl("~/Scheduler/Backend"),
  ...
  ContextMenuSelection = "rmenu"
})%>
Comment posted by Scott Mitchell
10 years ago.

Dan, I tried the above but with no success.

@Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig {
ContextMenu = "menu",
ContextMenuSelection = "menu",
...
}

The menu "menu" exists and works well when I right-click on an event, but when I right-click on an empty space in the scheduler no context menu comes up.

I am using DayPilot version 7.3.5519.1

Thanks

Comment posted by Scott Mitchell
10 years ago.

Nevermind, it works - I had to change:

TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.Disabled

To:

TimeRangeSelectedHandling = TimeRangeSelectedHandlingType.JavaScript

Thanks, Dan!

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