How to fire AppointmentCreated when Scheduler is in a Repeater

9 posts, 2 answers
  1. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 03 Sep 2009 Link to this post

    This is the code stub I was using to display appointment data on the schedule control 

     

    Protected Sub RS_AppointmentCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) 

    Handles RS.AppointmentCreated

     

     

    ----
    ----
    End
    Sub

    The Scheduler is now inside a repeater control what do I need to do to get this to work. (The handles RS cant get a handle on the control as its inside the repeater)

    Andy
  2. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Peter
    Admin
    Peter avatar
    6637 posts

    Posted 03 Sep 2009 Link to this post

    Hello Andy,

    I replied in the other forum thread, but here is the solution in case someone else needs it:

    This is a VB.NET problem. The solution which I found in the forums is to set the event handler declaratively:

    * * *  
     
    <telerik:RadScheduler runat="server" ID="RadScheduler1" OnAppointmentCreated="RadScheduler1_AppointmentCreated">  
     
    * * * 

    and to remove "Handles RadScheduler1.AppointmentCreated" from the event handler:

    Protected Sub RadScheduler1_AppointmentCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs)  
     
    End Sub 




    Greetings,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 03 Sep 2009 Link to this post

    Thank you, I thought the other post was dead.

    One more thing, how do I stop the drag and drop whilst still fire the FormCreating event

    Andy
  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 04 Sep 2009 Link to this post

    Hello Andy,

    FormCreating fired as expected in my test page. Please, download the attached demo and let us know what is different in your case.


    Greetings,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 04 Sep 2009 Link to this post

    Thanks Peter

    I got it working and edited my post, but not before you spent time on it , sorry about that. It was a build issue. I didn't rebuild between tries, most times you dont have to, but thats what it was.

    My only problem now is disabling drag and drop, whilt still allowing the Formcreating event to fire. If I turn off editing then the event doesn't fire.

    Andy
  8. Answer
    Peter
    Admin
    Peter avatar
    6637 posts

    Posted 04 Sep 2009 Link to this post


    To disable dragging of appointments, you can cancel OnClientAppointmentMoving:

     <script type="text/javascript">  
            function OnClientAppointmentMoving(sender, eventArgs) {  
                eventArgs.set_cancel(true);  
            }  
        </script> 
         <telerik:RadScheduler runat="server" ID="RadScheduler1"   
               OnClientAppointmentMoving="OnClientAppointmentMoving"


    Regards,
    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Andy Green
    Andy Green avatar
    120 posts
    Member since:
    Jul 2009

    Posted 07 Sep 2009 Link to this post

    Ok One last question on this.

    Following on from your previous answer I've used the following to stop the resizing:

    OnClientAppointmentResizing

     

    ="OnClientAppointmentResizing"

     

     

    function OnClientAppointmentResizing(sender, eventArgs) {

     

    eventArgs.set_cancel(

    true);

     

    }


    But the event is still firing, what have I missed.
    Andy
  10. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 08 Sep 2009 Link to this post

    Hello Andy,

    This is strange. In our test project, resizing was canceled as expected using this code. Can you open a support ticket and send us a simple working demo which we can test locally?



    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017