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

Call The Delete Appointment without Confirmation

1 Answer 148 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
loowool
Top achievements
Rank 2
loowool asked on 15 Sep 2011, 02:03 PM
Hi,

After a successful drag and drop operation that creates a new appointment, and based on some logic, we call the following function to manually force open the Edit Appointment Dialog Box so we can collect some additional attributes:
scheduleView.Dispatcher.BeginInvoke(() => { RadScheduleViewCommands.EditAppointment.Execute(proApp, scheduleView); });
We're then capturing the Ok and Cancel buttons to do some validation of the newly created appointment.

We have 2 issue that we'd like your valuable help on:

1) If the user presses the Cancel button, we'd like to remove the newly created appointment, but since the appointment has been created already, we need to delete it, so we're calling the following command:
ScheduleView.Dispatcher.BeginInvoke(() => { RadScheduleViewCommands.DeleteAppointment.Execute(proApp, ScheduleView); });
The appointment is getting deleted, but the Confirm Delete dialog box is showing. Is there a way to NOT show this Confirm Dialog in this case?

2) If the user instead of the Ok or Cancel buttons presses the dialog "x" button, we could not capture this action to do any validation. Is there any way to capture this "x" event? Or, Does this "x" fire any event that we could hook into? Or, Can we disable this "x" button?

Thanks as always
Salah A. Malaeb
TeknoBuild

1 Answer, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 20 Sep 2011, 02:41 PM
Hello,

Straight to the questions:
1) You could just remove the appointment from the collection (state.DestinationAppointmentsSource if you have reference to the state) - the DeleteAppointment command does just that. If you use the command, you could prevent the confirmation dialog from appearing by following the instructions in this help article:
http://www.telerik.com/help/silverlight/radscheduleview-howto-prevent-dialogs-from-opening.html

2) I don't know how do you capture the OK/Cancel clicks, but you could disable the X button by creating a custom ScheduleViewDialogHostFactory - create a new class, deriving from Telerik.Windows.Controls.ScheduleView.ScheduleViewDialogHostFactory and override the CreateNew method. In this method you could configure the RadWindow object returned by the base class method so that the X button is disabled:
http://www.telerik.com/help/silverlight/radwindow-features-closing.html

Regards,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ScheduleView
Asked by
loowool
Top achievements
Rank 2
Answers by
Valeri Hristov
Telerik team
Share this question
or