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

Daily Recurrence does not appear correctly on radscheduler

4 Answers 304 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
imran syed
Top achievements
Rank 1
imran syed asked on 17 Feb 2010, 12:54 PM
Hello,

I am trying to create a daily appointment into rad scheduler by using code. As i want to achieve 2 possible scenarios 

a)  create a daily appointment that appears on the rad scheduler on every Monday till the end date of the appointment.
b)  create daily appointment that shows on the scheduler based on the time interval of day for example:- recurrence of appointment after 1,10,15,20,30,100 etc 

although i partially manage to complete the first scenario to recur appointment every monday but it showing only 3 recurrence in month instead of 4 times during the dates between 2/1/1010 and 3/1/2010.  this is my code which i am using to create the appointment can you tell me is i am doing something wrong... 

 DateTime startTime = new DateTime(2010, 2, 1, 9, 0, 0)

   // Creates a recurrence range, that specifies a limit of 4 occurrences for the appointment.
        RecurrenceRange range = new RecurrenceRange();
        range.Start = startTime;
        range.EventDuration = new TimeSpan(1, 0, 0);
        range.MaxOccurrences = 4;
        range.RecursUntil = DateTime.MaxValue;

      // Creates a recurrence rule to repeat the appointment every Monday.
        DailyRecurrenceRule rrule = new DailyRecurrenceRule(RecurrenceDay.Monday, range);
        
        Appointment recurringAppointments = new Appointment("1", Convert.ToDateTime("2/1/2010"), Convert.ToDateTime("3/15/2010"), "Recurring appointment", rrule.ToString(), null, RecurrenceState.Occurrence);
        recurringAppointments.RecurrenceRule = rrule.ToString();

        RadScheduler1.InsertAppointment(recurringAppointments);
        RadScheduler1.DataBind();

Also enclosing the screen shots that shows on 3 recurrence appointment in a month.

For the second scenario i am  doing everything the same just changing the daily recurrence rule  based on days such as 
 DailyRecurrenceRule rrule = new DailyRecurrenceRule(20, range);

 but if i have interval with more than 17 days its not showing recurring appointment... enclosing the second screenshot with filename: RecurrenceByDay for  your reference

Can you also please show me how to create a reference rule for weekly & monthly !

I look forward to hear from you.

Thanks,
Imran 

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 22 Feb 2010, 11:57 AM
Hello imran,

1. I tested your code, but I got 4 appointments as expected. Attached is a simple demo.

2. You can create recurring appointment which occurs at regulare intervals. For example:

//Create appoinment that occurs every 5 days for 4 occurrences
      DateTime startTime = new DateTime(2010, 2, 1, 9, 0, 0);
      RecurrenceRange range1 = new RecurrenceRange();
      range1.Start = startTime;
      range1.EventDuration = new TimeSpan(1, 0, 0);
      range1.MaxOccurrences = 4;
      range1.RecursUntil = DateTime.MaxValue;
      DailyRecurrenceRule rrule1 = new DailyRecurrenceRule(5, range1);
      Appointment recurringAppointment1 = new Appointment("2", startTime, startTime.AddHours(1), "occurs every 5th day", rrule1.ToString(), null, RecurrenceState.Occurrence);
      recurringAppointment1.RecurrenceRule = rrule1.ToString();
      RadScheduler1.InsertAppointment(recurringAppointment1);

Note, that irregular patterns such as 1,10,15,20,30,100 are not supported.


Best wishes,
Peter
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
imran syed
Top achievements
Rank 1
answered on 03 Mar 2010, 12:48 PM
Hi Peter,

Thanks very much for the code, your guidance is really appreciated.

Regards,
Imran
0
prabha
Top achievements
Rank 1
answered on 01 Dec 2010, 06:18 AM
Hi,

   I am working with RadScheduler.For my case,I customize the Rad Scheduler for Events.
Created Event with Subject,Start Date ,EndDate Field.It works well .I have to incorporate Recurrence in the RadScheduler .
For the Recurrence ,I added RecurenceParent ID and Recurence Rule in the Event Table.

  And What are the thing to do .?If the Event does not have recurrence i saved the recurrence ParentID as zero.
But its not working .Please give me the following details.

1.What are the things to be saved in recurrence rule?
2.Is the Recurrence Parent id as Event ID or Shall i need to create child table for this.>

i maintained all are the things in the Event Table only .Please give me any procedure to incorporate recurrence .

Thanks in advance
Prabha
    
0
Peter
Telerik team
answered on 01 Dec 2010, 05:24 PM
Hello Prabha,

Please, review the Database structure and make sure you set the DataRecurrenceField and DataRecurrenceParentKeyField to the corresponding fields.


Greetings,
Peter
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
imran syed
Top achievements
Rank 1
Answers by
Peter
Telerik team
imran syed
Top achievements
Rank 1
prabha
Top achievements
Rank 1
Share this question
or