Hello Andrew,
Please excuse me for delaying your answer.
Here is one way we can "
cut" the recurrence appointment and create the new appointment so that the recurrence rule is in the regular size by catching the
ReccurenceExceptionCreated. You can also try the following variation and decide which one fits your needs better:
protected
void
RadScheduler1_RecurrenceExceptionCreated(
object
sender, RecurrenceExceptionCreatedEventArgs e)
{
Response.Write(e.Appointment.RecurrenceRule.Length);
int
size = 50;
if
(e.Appointment.RecurrenceRule.Length > size)
{
RecurrenceRule parsedRule;
RecurrenceRule.TryParse(e.Appointment.RecurrenceRule.ToString(),
out
parsedRule);
parsedRule.Range.RecursUntil = e.OccurrenceAppointment.End.AddMinutes(-1);
Appointment newApp =
new
Appointment();
newApp.Subject =
"New"
+ e.Appointment.Subject;
newApp.Start = e.OccurrenceAppointment.Start;
newApp.End = e.OccurrenceAppointment.End;
RecurrenceRule newParsedRule;
RecurrenceRule.TryParse(e.Appointment.RecurrenceRule.ToString(),
out
newParsedRule);
newParsedRule.Exceptions.Clear();
newParsedRule.Range.Start = e.OccurrenceAppointment.Start;
newParsedRule.Range.EventDuration = e.OccurrenceAppointment.Duration;
newApp.RecurrenceRule = newParsedRule.ToString();
e.Appointment.RecurrenceRule = parsedRule.ToString();
RadScheduler1.InsertAppointment(newApp);
}
}
This one does not have the 24 hour shift as in the attached demo.
Hope this will help you. If you have further questions please don't hesitate to ask.
Regards,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their
blog feed now