I need to run a function if the user clicked "YES" when given the delete appointment dialog box. Is there any way to know what has been answered through code?
Danko,
Thanks for the response and the sample code, works great.
Rod McNeil
Hello rmcneil,
One way the you could follow here is something like the following one:
1. Disable the default Prompt Dialog.2. Handle the BeforeAppointmentsDeleted event3. Create your own message box there.4. Decide what to happen if the yes is clicked.
Please take a look at the code below:
private void ultraDayView1_BeforeAppointmentsDeleted(object sender, BeforeAppointmentsDeletedEventArgs e) { e.DisplayPromptMsg = false; if (MessageBox.Show("Caution - The Appointments will be deleted", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { //do what you need here } else { e.Cancel = true; } }
If you have any other questions please feel free to ask.