Disable editing but still want events

5 posts, 0 answers
  1. PaulMrozowski
    PaulMrozowski avatar
    80 posts
    Member since:
    Apr 2007

    Posted 31 Mar 2008 Link to this post

    I want a "read only" version of the calendar, but I'd like the users to be able to double-click on appointments to view their detail. If I set "AllowEdit" to false, the OnAppointmentClick event doesn't fire. If I enable it, the users can do things like drag and drop the appointments (which I definitely don't want). Any thoughts on how I can do this?
  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 02 Apr 2008 Link to this post

    Hi Paul,

    You can use the OnClientAppointmentDoubleClick instead of the server event. The client event will fire even if the appointment is read-only.

    function OnClientAppointmentDoubleClick(sender, eventArgs)  
    {                     
        var subject = eventArgs.get_appointment().get_subject();  
        alert(subject);
        



    Peter
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin de Ruiter
    Martin de Ruiter avatar
    99 posts
    Member since:
    Jun 2005

    Posted 02 Apr 2008 Link to this post

    I also needed a read-only scheduler, however I wanted to be able to use the serverside events. So I had to use another approach. Basically what I do is something like calling in the OnAppointmentClick event:

    e.Cancel = True
    'Execute my own logic

    That way I can use the serverside events, while using some sort of read-only mode.
  5. sreedevi
    sreedevi avatar
    8 posts
    Member since:
    Mar 2008

    Posted 02 Apr 2008 Link to this post

    I am also in need of a readonly scheduler. But I am not seeing e.Cancel in OnAppointmentClick  event. Could you please post your code to understand it better?
  6. Martin de Ruiter
    Martin de Ruiter avatar
    99 posts
    Member since:
    Jun 2005

    Posted 02 Apr 2008 Link to this post

    Well for example, I want to disable that the scheduler creates its forms:

    Private Sub SAgenda_FormCreating(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerFormCreatingEventArgs) Handles SAgenda.FormCreating  
        e.Cancel = True 
        If (e.Appointment.ID Is Nothing) Then  
            'Do stuff  
        Else  
            'Do other stuff  
        End If  
    End Sub 

    Then using AppointmentClick I can do what I want too:

    Private Sub SAgenda_AppointmentClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.SchedulerEventArgs) Handles SAgenda.AppointmentClick  
        'Do what I want  
    End Sub 
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017