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

No RecurrenceRule data on OnAppointmentInsert

10 Answers 128 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 19 Jun 2008, 07:15 PM
Hi,

I have a function:

protected void scheduler_AppointmentInsert(Object sender, SchedulerCancelEventArgs e) 
... 

When using all of RadScheduler's default templates for inserting and such, RecurrenceRule always seems to be empty and RecurrenceState is always NotRecurring. I'm using e.Appointment.RecurrenceRule to try to access it. All of the other data is there (title, end time, start time)

As far as I know, we are currently using the most up-to-date patch (that isn't officially released yet). Is this a bug or am I doing something wrong?


10 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 19 Jun 2008, 07:47 PM
Nevermind, I figured it out.

I was setting the DataRecurrenceField and DataRecurrenceKeyField properties declaratively, which allowed the Recurrence options to show up in the Insert dialog, but wouldn't allow them to actually be passed.
0
Doug Beard
Top achievements
Rank 2
answered on 05 Jun 2009, 07:24 PM
I'm NOT setting mine declaritively, rather doing it programatically (although I've tried both), recurrence is always NotRecurring and RecurringParentID=null...

What am I missing?
0
Doug Beard
Top achievements
Rank 2
answered on 08 Jun 2009, 01:13 PM
Anyone know the secrete of the RecurrenceState?  No matter what approach I use, and none of the demos either, the RecurrenceState is always =NotRecurring.  I'm checking the RecurrenceRule for string.empty and setting the RecurrenceState manually, but this approach doesn't work 100%.
0
Peter
Telerik team
answered on 08 Jun 2009, 03:04 PM
Hi Doug,

We are not sure why you experience this problem. Can you open a support ticket and send us a simple demo of the issue?

RecurrenceState is enum with four possible values:

RecurrenceState.Exception;
RecurrenceState.Master;
RecurrenceState.NotRecurring;
RecurrenceState.Occurrence;

There aren't any known issues with RecurrenceState at the moment.


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Soft4Care
Top achievements
Rank 2
answered on 22 Jun 2009, 11:23 AM
I have the same problem. I was using a customized AdvancedFormTemplate and now it doesn't work. I can't get the RecurrenceRule.
0
Peter
Telerik team
answered on 22 Jun 2009, 03:51 PM
Hi Torres,

Please, open a ticket and send us a simple demo of the issue.


Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Doug Beard
Top achievements
Rank 2
answered on 06 Jul 2009, 08:56 PM
A 'simple demo' is impossible since the DB can not be included.
This problem occurs with all setups, including the demos provided with the installer, it should be very easy for you to recreate.

The appointment in SchedulerCancelEventArgs of the AppointmentInsert handler is ALWAYS RecurrenceState.NotRecurring.

I'm currently manually setting it to RecurrenceState.Master but I have symptoms in recurring appointments I believe are related to this problem.  Such as upon immediate postback after a Recurring appointment insert the first occurrence of the appointment shows the broken recurrence symbol.  If one attempts to edit the series from that partical occurence an error is thrown complaining about the RecurringParentID.  However, if you refresh (F5) the page, it works as expected.  Any subsequent navigation to the page works as intended, only the immediate postback is problematic.

All of this is symptomatic of having to physically set RecurrenceState.Master

I suggest adding a NeedDataSource pattern would be infinitely helpful in datasource customization and overcoming problems such as this.
0
Veselin Vasilev
Telerik team
answered on 09 Jul 2009, 11:56 AM
Hello guys,

You are all right - in AppointmentInsert the RecurrenceState is NotRecurring and this is not the expected state. We logged the problem in our bug tracking system and will fix it for the next service pack.

As a workaround you can set this property manually and this should not cause any additional problems.

Best wishes,
Veselin Vasilev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
towpse
Top achievements
Rank 2
answered on 19 Nov 2009, 05:22 PM
Can anyone comment whether this has been resolved?
I am using 2009.3.1103.35 and I am still seeing this.
I am using the web service binding approach.

        <telerik:RadScheduler    ID="RadScheduler1"  
                                            runat="server"  
                                            Height="800" 
                                            HoursPanelTimeFormat="htt"  
                                            ValidationGroup="RadScheduler1"  
                                            Skin="WebBlue" SelectedView="WeekView"  
            ShowFullTime="True" StartInsertingInAdvancedForm="True"  
            MaximumRecurrenceCandidates="10000" > 
            <WebServiceSettings Path="SchedulerWebService.asmx"  
                ResourcePopulationMode="ClientSide" /> 
            <advancedform maximumheight="550px" modal="True"  
                enablecustomattributeediting="True" enableresourceediting="False" /> 
            <AppointmentContextMenuSettings EnableDefault="true" /> 
        </telerik:RadScheduler> 

        private WebServiceAppointmentController _controller; 
 
        /// <summary> 
        /// The WebServiceAppointmentController class is used as a facade to the SchedulerProvider. 
        /// </summary> 
        private WebServiceAppointmentController Controller 
        { 
            get 
            { 
                if (_controller == null) 
                { 
                    _controller = new WebServiceAppointmentController(new OutputControlScheduleProvider()); 
                } 
                return _controller; 
            } 
        } 

I double click on a Day in the calendar and I click the recurrence check box. The debugger immediately jumps me to the InsertAppointment method:

        [WebMethod] 
        public IEnumerable<AppointmentData> InsertAppointment(SchedulerInfo schedulerInfo, AppointmentData appointmentData) 
        { 
            return Controller.InsertAppointment(schedulerInfo, appointmentData); 
        } 

In appointmentData the recurrenceState parameter is unexpectedly set to NotRecurring even though the RecurrecneRule is properly set; at least it seems to be.


Also on a related side note, when should the parentRecurrenceId be set to some value?

Thanks.
0
T. Tsonev
Telerik team
answered on 25 Nov 2009, 07:53 AM
Hello,

You're correct - the RecurrenceState is not being set in this case. We'll fix this in a week or so, but in the meantime you can use this code to properly set it based on the RecurrenceRule and RecurrenceParentID properties:

RecurrenceState initialState = RecurrenceState.NotRecurring;
if (aptData.RecurrenceParentID != null)
{
    initialState = RecurrenceState.Exception;
}
else
    if (aptData.RecurrenceRule != string.Empty)
    {
        initialState = RecurrenceState.Master;
    }

The RecurrenceParentID is used to associate "recurrence exceptions" (edited appointments) with the recurrence series that they belong to. More info here:

http://www.telerik.com/help/aspnet-ajax/schedule_serversideworkingwithrecurringappointments.html

Best wishes,
Tsvetomir Tsonev
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.
Tags
Scheduler
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Doug Beard
Top achievements
Rank 2
Peter
Telerik team
Soft4Care
Top achievements
Rank 2
Veselin Vasilev
Telerik team
towpse
Top achievements
Rank 2
T. Tsonev
Telerik team
Share this question
or