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