DayPilot - Open-Source Outlook-Like Calendar/Scheduling Control for ASP.NET
Try the online demo: AJAX-style event creating, moving, resizing, and deleting • Context menu • Day view • Work week view • Week view • Month view • Horizontal/vertical resources view • PostBack/AJAX/JavaScript event handling • Binding to XmlDataSource, SqlDataSource, DataTable, ArrayList • Custom event formatting • UpdatePanel compatibility

Event click handling

Events

DayPilotCalendar can handle both single- and double-click events:

  • EventClick
  • EventDoubleClick
  • EventRightClick

Handling mode

You can set the handling mode by changing EventClickHandling or EventDoubleClickHandling properties. Available modes:

  • Disabled (default value)
  • JavaScript (runs custom code on the client side)
  • PostBack (runs the server-side event handler using PostBack)
  • CallBack (runs the server-side event handler using CallBack)
  • Edit (enters inline edit mode)
  • Select (selects the event, fires EventSelect event depending on EventSelectHandling value)
  • Bubble (shows a bubble for this event, see also Extended ToolTips (bubbles))

JavaScript handling gives you the greatest flexibility. You can execute your own client-side code and than execute CallBack or PostBack.

Example:

<DayPilot:DayPilotCalendar runat="server"
EventClickHandling="JavaScript"
EventClickJavaScript="eventClick(e)"
ClientObjectName="dpc"
DataTagFields="status"
...
/>

Client-side handler:

function eventClick(e) {
  // only fire the server-side event if the ID is 5 or status field is set to tentative
  if (e.value() == "5" || e.tag("status") == "tentative") {
    dpc.eventClickCallBack(e);
  }
}

Double clicks

Double clicks are detected automatically: no EventClick event will be fired if the second click happens within 300 ms:

  • You can use both EventClick and EventDoubleClick event handlers at the same time.
  • Each of these events can perform a different action, e.g. inline editing on double click, opening event bubble on single click.

DayPilot Pro is an advanced DayPilot edition. You can check a thumbnail overview of the most interesting features. There is also an online demo with all the features working (including the AJAX features). If you want to test the design-time support and API you can download a fully functional trial version. And if you like it, you can buy a full version with source code and 12 months of upgrades and support (with a 30-days money back guarantee).

DayPilot Lite is a do-it-yourself open-source edition of DayPilot. Although it misses some DayPilot Pro features, there are thousands of developers using it to build calendar, personal scheduling, and resource booking applications.

Questions or suggestions? Try DayPilot forums or contact us directly.