Determine the user's action when creating custom ScheduleView dialog host

4 posts, 1 answers
  1. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 25 Jul 2012 Link to this post

    Hello,

    I have a question about the CreateNew method of the ScheduleViewDialogHostFactory. My override is:
    protected override IScheduleViewDialogHost CreateNew(ScheduleViewBase scheduleView,
                                                        DialogType dialogType)

    {
    if (dialogType == DialogType.RecurrenceChoiceDialog)
    {
    // ?
    }
    return base.CreateNew(scheduleView, dialogType);
    }

    I want to create custom confirmation dialogs for recurring appointments (with custom viewmodel implementations, which handle confirmations and cancellations in a specific fashion). What I can't figure out is: how do I know, which action (delete/resize/edit) was invoked, when the CreateNew method is in scope? All that I can retrieve from the DialogType enumeration is, that it is a recurring appointment (hence the DialogType.RecurrenceChoiceDialog flag).

    Any help would be greatly appreciated,
    Thanks.
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 30 Jul 2012 Link to this post

    Hi Sandi,

    I am afraid that there is no way to determine whether the appointment was edited/dragged/resized in this method. Could you please give us more details about your scenario, so we can try to find a more suitable solution? Thanks

    Regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Sandi Markon
    Sandi Markon avatar
    101 posts
    Member since:
    Jul 2012

    Posted 30 Jul 2012 Link to this post

    Thank you for your answer.

    What I'm trying to achieve is to have a custom confirmation dialog for deleting recurring appointments.
    The default dialog consists of two choices; either to delete the selected occurrence, or the entire series.
    I want to add two more choices. Namely:

    • Delete every occurrence from the first one to the selected one (by setting the 'RecurrsUntil' property)
    • Delete every occurrence from the selected one to the last one (by changing the starting date)

    My attempt was to create a custom dialog with a custom ViewModel (inheriting from RecurrenceChoiceDialogViewModel), but I didn't want to interefere with the logic, when the user wanted to edit, drag or resize the appointment.

    Any ideas?
    Thank you.
  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 02 Aug 2012 Link to this post

    Hello Sandi,

    Thank you for sending the additional details.

    I would suggest to customize the RecurrenceChoiceDeleteDialog by setting RecurrenceChoiceDeleteDialogStyle property - you could add the additional options in the template. Also in the attached project I have demonstrated how you can replace the RecurrenceChoiceDialogViewModel with a custom ViewModel. Note that the new ViewModel has a reference to the old one, so you will be able to use the built-in functionality.

    Please download the attached project and give it a try. 

    All the best,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top