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

Deleting Recurrences

2 Answers 141 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 2
Stephen asked on 09 Jul 2012, 06:58 PM
Hello,

I have a scenario where the RadScheduler behaviour seems odd.  It is reproducible in the demo applications.

Let's day I have a simple recurring appointment at 5PM for 3 occurrences.  The occurrences show up as Mon-Tue-Wed with the recurring symbol in the corner.
Then I edit the Wednesday appointment and change something/anything.  The Wednesday appointment shows the exception symbol in the corner.
Then I open the series and remove the recurrence.  This removes the recurring symbol from Monday, removes Tuesday entirely, but leaves Wednesday alone(so it still shows up as an exception).  If I do this in Outlook, the exception on Wednesday is also removed along with Tuesday.
Now, if I then delete Monday(which appears as a single appointment), both Monday and Wednesday now disappear even though Monday appears as a single appointment.  This is because Wednesday has retained Monday as its MasterEvent...even though Monday should no longer have an recurring information.

This behaviour does not match Outlook, it breaks down when recurrence is removed from the series by "abandoning" the exception.


Also, is it possible to have a "Delete this occurrence"/"Delete the series" prompt when you press Del on a recurring appointment in the calendar?



Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Todorov
Telerik team
answered on 10 Jul 2012, 11:48 AM
Hi John,

Thank you for contacting us.

Indeed, RadScheduler does not behave correctly when there are recurrence exceptions and you remove the recurrence rule from the master appointment. I have logged this in PITS as an issue and we will address this in a future release. Here you can find the PITS item. For the time being, you can use the following workaround:
public Form1()
{
    InitializeComponent();
    this.radScheduler1.AppointmentEditDialogShowing += new EventHandler<AppointmentEditDialogShowingEventArgs>(radScheduler1_AppointmentEditDialogShowing);
}
 
void radScheduler1_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
{
    e.AppointmentEditDialog = new MyEditAppointmentDialog();
}
 
class MyEditAppointmentDialog : EditAppointmentDialog
{
    protected override void ApplySettingsToEvent(IEvent targetEvent)
    {
        base.ApplySettingsToEvent(targetEvent);
        if (targetEvent.RecurrenceRule == null && targetEvent.Exceptions.Count > 0)
        {
            targetEvent.Exceptions.Clear();
        }
    }
}

As to your request about a dialog when pressing the Delete key, we have that logged in our internal system but no one has requested this so far. I have logged this in PITS as a feature request, so our clients can vote for it. Here is the link to the PITS item. For the time being you can implement a custom dialog by handling the AppointmentDeleting event of RadScheduler. The following snippet demonstrates this:
private void radScheduler1_AppointmentDeleting(object sender, Telerik.WinControls.UI.SchedulerAppointmentCancelEventArgs e)
{
    if (e.Appointment.MasterEvent != null)
    {
        if (RadMessageBox.Show("Would you like to delete the entire series", "Delete", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
        {
            this.radScheduler1.Appointments.Remove(e.Appointment.MasterEvent);
            e.Cancel = true;
        }
    }
}

Your Telerik points have been updated.

Do not hesitate to contact us if you have any further questions.

Regards,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
Stephen
Top achievements
Rank 2
answered on 10 Jul 2012, 01:56 PM
Thanks.  Both workarounds seem to be working.  I'll let you know if anything comes up.
Tags
Scheduler and Reminder
Asked by
Stephen
Top achievements
Rank 2
Answers by
Ivan Todorov
Telerik team
Stephen
Top achievements
Rank 2
Share this question
or