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

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

3 Answers 142 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sandi Markon
Top achievements
Rank 1
Sandi Markon asked on 25 Jul 2012, 08:50 AM
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.

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 30 Jul 2012, 09:01 AM
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.

0
Sandi Markon
Top achievements
Rank 1
answered on 30 Jul 2012, 12:38 PM
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.
0
Accepted
Yana
Telerik team
answered on 02 Aug 2012, 03:51 PM
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.

Tags
ScheduleView
Asked by
Sandi Markon
Top achievements
Rank 1
Answers by
Yana
Telerik team
Sandi Markon
Top achievements
Rank 1
Share this question
or