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

How to identify Recurrence deletion

2 Answers 47 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Art Kedzierski
Top achievements
Rank 2
Art Kedzierski asked on 26 Sep 2013, 03:12 PM
In my custom RadScheduleView deployment, I allow RecurrencePatterns but not RecurrenceExceptions. When a user attempts to edit/delete an appointment series, I want to bypass the RecurrenceChoiceDialog and go directly to the series (in the case of an edit) or pop up a simple "Delete series?" confirmation if a deletion. I can tell when an RecurrenceChoiceDialog is being fired, but I cannot figure out whether it is initiating an edit or delete event.

public void Appointment_ShowDialog(object sender, ShowDialogEventArgs e)
{
    var rcdvm = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
    if (rcdvm != null)
    {
        rcdvm.IsSeriesModeSelected = true;
        e.DefaultDialogResult = true;
        e.Cancel = true;
    }
}
  
This code works fine for jumping straight to the EditAppointmentDialog in the case of an edit, but how do I determine if it's a deletion? 

2 Answers, 1 is accepted

Sort by
0
Art Kedzierski
Top achievements
Rank 2
answered on 26 Sep 2013, 03:23 PM
I think I figured it out. It's RecurrenceChoiceDialogMode (which has no documentation describing its function, merely its existence). That and a custom  RecurrenceChoiceDeleteDialogStyle should do the trick.

public void Appointment_ShowDialog(object sender, ShowDialogEventArgs e)
{
    var rcdvm = e.DialogViewModel as RecurrenceChoiceDialogViewModel;
    if (rcdvm != null && rcdvm.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Opening)
    {
        rcdvm.IsSeriesModeSelected = true;
        e.DefaultDialogResult = true;
        e.Cancel = true;
    }
    else if (rcdvm != null && rcdvm.RecurrenceChoiceDialogMode == RecurrenceChoiceDialogMode.Deleting)
    {
        rcdvm.IsSeriesModeSelected = true;
    }
}
0
Kalin
Telerik team
answered on 01 Oct 2013, 11:55 AM
Hello Art,

Thanks for your feedback, we will consider adding information about the RecurrenceChoiceDialogMode in the online help documentation.

If you have any other questions let us know.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ScheduleView
Asked by
Art Kedzierski
Top achievements
Rank 2
Answers by
Art Kedzierski
Top achievements
Rank 2
Kalin
Telerik team
Share this question
or