This is a migrated thread and some comments may be shown as answers.

RadScheduler Contol Delete Event gets Fired Twice...

5 Answers 147 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mayur
Top achievements
Rank 1
Mayur asked on 08 Nov 2011, 01:39 PM
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.

5 Answers, 1 is accepted

Sort by
0
Azia
Top achievements
Rank 1
answered on 10 Nov 2011, 10:57 AM
Hi,

I'm also facing the same issue.
Can anyone provide a solution to this issue?? I'll be thank full.
0
Ivana
Telerik team
answered on 11 Nov 2011, 01:09 PM
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
0
Mayur
Top achievements
Rank 1
answered on 11 Nov 2011, 01:21 PM

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>

0
Ross Dunham
Top achievements
Rank 1
answered on 16 Nov 2011, 06:49 AM
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!


0
Ivana
Telerik team
answered on 16 Nov 2011, 08:45 AM
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
Tags
Scheduler
Asked by
Mayur
Top achievements
Rank 1
Answers by
Azia
Top achievements
Rank 1
Ivana
Telerik team
Mayur
Top achievements
Rank 1
Ross Dunham
Top achievements
Rank 1
Share this question
or