RadScheduler Contol Delete Event gets Fired Twice...

6 posts, 0 answers
  1. Mayur
    Mayur avatar
    6 posts
    Member since:
    Jul 2011

    Posted 08 Nov 2011 Link to this post

    Hello,

    I have below RadScheduler control on my page. Code as below:

    <asp:Content ID="Content1" ContentPlaceHolderID="main" runat="Server">
        <telerik:RadScheduler runat="server" ID="schedular" DataKeyField="ID" DataSubjectField="Subject"
            DataStartField="Start" DataEndField="End" StartEditingInAdvancedForm="true" DataRecurrenceField="RecurrenceRule"
            DataRecurrenceParentKeyField="RecurrenceParentID" OnAppointmentInsert="schedular_AppointmentInsert"
            OnAppointmentDelete="schedular_AppointmentDelete" StartInsertingInAdvancedForm="true">
        </telerik:RadScheduler>
    </asp:Content>

    I can insert the appointment easily but when I delete the appointment the Delete event (OnAppointmentDelete = "schedular_AppointmentDelete") gets Fired twice.

    If I remove the recurrence properties (i.e.DataRecurrenceField, DataRecurrenceParentKeyField) then it works fine but I need Recurrence functionality.

    Please let me know the solution to this problem.

    Thanks,
    Mayur.
  2. Azia
    Azia avatar
    1 posts
    Member since:
    Nov 2011

    Posted 10 Nov 2011 Link to this post

    Hi,

    I'm also facing the same issue.
    Can anyone provide a solution to this issue?? I'll be thank full.
  3. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 11 Nov 2011 Link to this post

    Hello Azia,

    I did not manage to reproduce this behavior locally. When I delete a non-recurrent appointment, the OnAppointmentDelete event fires only once. When deleting a recurrent appointment, the same event fires only when the whole series of the appointments is deleted, it  does not fire if a single occurrence is deleted.

    If you are still having troubles, could you please send us a support ticket, where a sample page could be attached to the message. Please provide us with a runnable web page, so I will be able to troubleshoot this behavior locally.

    Best wishes,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  4. Mayur
    Mayur avatar
    6 posts
    Member since:
    Jul 2011

    Posted 11 Nov 2011 Link to this post

    HI Ivana,

    Here is the code Block. Pages is using a master page having no special functionality.

    Thanks,
    Mayur.

    <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
        CodeFile="SchedulerBlockTimeSlots.aspx.cs" Inherits="SchedulerBlockTimeSlots" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID="main" runat="Server">
        <telerik:RadToolBar ID="Menu" runat="server" Width="100%">
            <Items>
                <telerik:RadToolBarDropDown Text="Block Time" Font-Names="Verdana" CssClass="MenuButton"
                    Enabled="false" ForeColor="Black" Font-Bold="true">
                </telerik:RadToolBarDropDown>
            </Items>
        </telerik:RadToolBar>
        <table>
            <tr>
                <td>
                    <div style="height: 10px">
                    </div>
                    <asp:Label ID="lblErrorMessage" runat="server" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadScheduler runat="server" ID="schedular" DataKeyField="ID" DataSubjectField="Subject"
                        DataStartField="Start" DataEndField="End" EnableDescriptionField="True" StartEditingInAdvancedForm="true"
                        AdvancedForm-Width="300px"  Height="700px"  Width="100%" MinutesPerRow="15" NumberOfHoveredRows="1"
                        TimeLabelRowSpan="4" DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
                        OnAppointmentInsert="schedular_AppointmentInsert" OnAppointmentDelete="schedular_AppointmentDelete"
                        OnAppointmentUpdate="schedular_AppointmentUpdate" OnAppointmentDataBound="schedular_AppointmentDataBound"
                        ValidationGroup="validate" StartInsertingInAdvancedForm="true" OnNavigationCommand="schedular_NavigationCommand"
                       >
                    </telerik:RadScheduler>
                </td>
            </tr>
        </table>
    </asp:Content>

  5. Ross Dunham
    Ross Dunham avatar
    11 posts
    Member since:
    Mar 2006

    Posted 16 Nov 2011 Link to this post

    Hi Mayur.
    I also had this happening to me.
    I found out that since I specify the sub to handle the delete in my ASPX file, that I did NOT need to  add the 'Handles schedular.AppointmentDelete' at the end of the SUB in my code behind file.

    I removed 'Handles schedular.AppointmentDelete'  from the end of my SUB and my event only fires once now.

    So if it looks like this...
    Protected Sub scheduler_AppointmentDelete(sender As Object, e As Telerik.Web.UI.AppointmentDeleteEventArgs) Handles schedular.AppointmentDelete

    make it looks like this...
    Protected Sub scheduler_AppointmentDelete(sender As Object, e As Telerik.Web.UI.AppointmentDeleteEventArgs)

    Now my delete event only fires once.
    Not sure if this is your problem, but I figured I would mention it.
    Good luck!


  6. Ivana
    Admin
    Ivana avatar
    657 posts

    Posted 16 Nov 2011 Link to this post

    Hi Mayur,

    I still could not produce the same behavior, locally. I have tested your code in a content page, which has nothing declared in its master page, except for the RadScriptManager definition. Everything works fine with the Scheduler and the server-side events are fired as expected.

    You could take a look at the video linked below, to see how the scheduler behaves at my end:
    RadScheduler: OnAppointmentDelete.

    Regards,
    Ivana
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top