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

appointment time does not show correctly when using recurrence rules

1 Answer 54 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Ming Zhao
Top achievements
Rank 1
Ming Zhao asked on 19 Aug 2010, 06:46 PM

In Q2 2010 SP1,  we use following codes to implment appointments using recurrencerule.  But the appointment time in recurring appointments do not show correctly ( see attached screen shot).  This happens to all recurrence rules ( monthly, weekly and daily)

==========================================================================================

 

radScheduler1.Appointments.Clear();

 

Appointment ap = new Appointment();

 

 

DailyRecurrenceRule drule = new DailyRecurrenceRule();

 

drule.Start =

DateTime.Today;

 

drule.End =

DateTime.Today.AddYears(2);

 

ap.Start =

new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 9, 0, 0);

 

ap.End =

new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 11, 0, 0);

 

ap.RecurrenceRule = drule;

radScheduler1.Appointments.Add(ap);

 

=================================================================

There is not problem , using the same codes in earlier versions such as Q2 2009

======================================================================

1 Answer, 1 is accepted

Sort by
0
Dobry Zranchev
Telerik team
answered on 20 Aug 2010, 10:44 AM
Hello Ming Zhao,

Thank you for writing.

Note that your code does not set the EndDate of the DayliRecurrenceRule object correctly. Please try the following snippet:

DateTime dtStart = new DateTime(DateTime.Today.Year, DateTime.Today.Month, DateTime.Today.Day, 9, 0, 0);
Appointment ap = new Appointment(dtStart, dtStart.AddHours(2));
DailyRecurrenceRule drule = new DailyRecurrenceRule(dtStart, DateTime.Today.AddYears(2).AddHours(2), 1);
 
ap.RecurrenceRule = drule;
 
radScheduler1.Appointments.Add(ap);

I hope this helps. Let me know if I can assist you further.

Greetings,
Dobry Zranchev
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
Tags
Scheduler and Reminder
Asked by
Ming Zhao
Top achievements
Rank 1
Answers by
Dobry Zranchev
Telerik team
Share this question
or