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

WeeklyRecurrence in RadScheduler

1 Answer 91 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Vish
Top achievements
Rank 2
Vish asked on 28 May 2009, 05:24 AM
Hai,
    I,m working with WeeklyRecurrence rule for rad scheduler .my problem is that when using the recurrence day for initializing the rule class , i'm unable to typecast system day to reccurrenceday . is thei any way to get the correct recurrence day for the corresponding system.date.daysofWeek.Imgiving my code below .can anybody help me its urgent.

 

Appointment rcAppointment = new Appointment("1", StartTime, StartTime.AddMinutes(15), "Menu");

 

 

 

RecurrenceRange rRange = new RecurrenceRange();

 

 

rRange.Start = rcAppointment.Start;

rRange.EventDuration = rcAppointment.End - rcAppointment.Start;

rRange.RecursUntil = StartTime.AddDays(8);

 

 

RecurrenceDay mask = (RecurrenceDay)(StartTime.DayOfWeek);

 

 

 

WeeklyRecurrenceRule rrule = new WeeklyRecurrenceRule(1, mask, rRange);

 

 

 

 

foreach (DateTime occurrence in rrule.Occurrences)

 

{

InsertData(StartTime);

StartTime = StartTime.AddDays(7);

}

When StartTime.DaysOFWeek is typecasted to recurrenceday .its Differnet from the actual day.......

thanks in advance

 

1 Answer, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 01 Jun 2009, 01:47 PM
Hello,

I agree that it might be a bit misleading, but the RecurrenceDay and DayOfWeek enum are not directly convertible. The RecurrenceDay is a flags enum and it's designed to allow you to combine different values in a bit-mask. The option here is to use a switch statement to convert between the two types.

Regards,
Tsvetomir Tsonev
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.
Tags
Scheduler
Asked by
Vish
Top achievements
Rank 2
Answers by
T. Tsonev
Telerik team
Share this question
or