How to identify Recurrence deletion

3 posts, 0 answers
  1. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 26 Sep 2013 Link to this post

    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. Art Kedzierski
    Art Kedzierski avatar
    107 posts
    Member since:
    Nov 2009

    Posted 26 Sep 2013 Link to this post

    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;
        }
    }
  3. DevCraft banner
  4. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 01 Oct 2013 Link to this post

    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 >>
Back to Top