Call The Delete Appointment without Confirmation

2 posts, 1 answers
  1. loowool
    loowool avatar
    60 posts
    Member since:
    Sep 2006

    Posted 15 Sep 2011 Link to this post


    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
  2. Answer
    Valeri Hristov
    Valeri Hristov avatar
    2252 posts

    Posted 20 Sep 2011 Link to this post


    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:

    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:

    Valeri Hristov
    the Telerik team

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

Back to Top