<< Scheduler linked menus  >> Show source code for this site
An example shows how to link a context menu to a scheduler.
Right-click on a resource, hours, date or an items rectangle.

You can use client side ContextMenu.OnClientMenuActivate event to initialize menu items before showing menu in the browser. Notice that one context menu is differentfor different items.

A Scheduler.Web library contains objects allowing you to define context menus. These are menus displayed after right clicking appropriate area and performing some actions on it.
A scheduler control has many areas, context menus can be assigned to. A way these pages are displayed and area-related events are defined by Sch.XxxxStyle properties corresponding to these areas. For example a BodyStyle corresponds to main scheduler grid, DefaultItemStyle corresponds to SchedulerItem objects displayed on it, and ResourceListStyle to a list (tree) of resources in a left part of a control.
Objects returned by these properties have among others a ContextMenuID property containing an identifier of a context menu displayed after right clicking an area. For example a Sch.CaptionStyle.ContextMenuID is a menu displayed on a scheduler title rectangle in an upper part of a control.
Assigning a context menu is done by creating a ContextMenu object and assigning its identifier to appropriate XxxxStyle.ContextMenuID property.
After a function from a menu is selected, a server event, client JavaScript or a HTML page can be called. This can be set using ContextMenu object properties, but it is always necessary to determine an area of a scheduler control a menu was opened for. Ex. for which SchedulerItem object a menu determined by a Sch.DefautlItemStyle.ContextMenuID property was opened. This can be done using ClickedItem, ClickedRow, ClickedColumn and ClickedDateTime properties locating a place right clicked.
After selecting a "Get Information" function from a menu on this sample page an appropriate server event assigned to a context menu is called. In this event an event that was called is precisely described along with corresponding ClickedXXX parameters. For example if a menu was opened for a ResourceList (a list or a tree in a left part of a control), information on ClickedRow and ClickedColumn is added to information on event type.


If you would look into a source code for this demo, click on the link.
For demonstration purposes all appointments displayed on a calendar are stored in ASP.NET session objects, so original values are restored immediately after a new session object is created.
A list of appointments and resources is intialized every time a new session is started.