RadCalendar with ContexMenu

Thread is closed for posting
3 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 19 Feb 2007 Link to this post

    Requirements

    RadCalendar
    RadMenu

    v2.0.x
    v4.0.x
    Web.UI version 2007.3.1425
    .NET version

    2.0
    Visual Studio version

    2005
    programming language

    JavaScript
    browser support

    all browsers supported by RadControls

    To convert code   Telerik online converter

     
    PROJECT DESCRIPTION
    The project demonstrates how a RadMenu instance can be used as a context menu to a RadCalendar. On load of the page window a contextmenu event handler is attached to the RadCalendar. When a date cell is clicked the context menu with two items ("Log Date" and "No Action") is shown and the clicked cell date is saved in a javascript object (named contextDate). When the first item is chosen, the clicked cell date is published to the page from the contextDate object value.

  2. Gene Grant
    Gene Grant avatar
    7 posts
    Member since:
    Sep 2005

    Posted 13 Jun 2007 Link to this post

    Great demo.
  3. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 08 Mar 2008 Link to this post

    Hi guys,

    We've attached Web.UI version of the project to this thread. The main difference is the new way of attaching handlers based on the MS AJAX library. If before we used to make checks for both Firefox and IE, now we can use a single line that is crossbrowser compatible:

    before:

    if (window.addEventListener) 
          { 
           document.getElementById("RadCalendar1").addEventListener("contextmenu", ShowContextMenu, false); 
          } 
    else 
          { 
           document.getElementById("RadCalendar1").attachEvent("oncontextmenu", ShowContextMenu); 
          } 

    after:

    $addHandler($get("RadCalendar1"), "contextmenu", ShowContextMenu); 

    Greetings,
    Steve
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top