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

AppointmentCreated Event - AppointmentDialog stay open

4 Answers 47 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 01 Sep 2013, 03:36 PM
Hi,

before i save a new appointment in my database, i have to check different issues. This i do in the "AppointmentCreated" Event.
If the Input is wrong i have to go back to the AppointmentDialog. The Problem is, that the Appointment is created an the Dialog
is closed. e.Cancel is not known.

How do i let the Dialog stay open?

Thanks
Rene

4 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 03 Sep 2013, 02:44 PM
Hello Rene,

My suggestion is to use the DialogClosing event instead of the AppointmentCreated in order to check for issues with the Appointment. This way you will be able to keep the EditAppointmentDialog open as needed. Please check the example below, in which the user won't be able to confirm the Dialog if the Subject field is empty:

private void ScheduleView_DialogClosing(object sender, CancelRoutedEventArgs e)
{
    var eventArgs = e as CloseDialogEventArgs;
    var scheduleView = sender as RadScheduleView;
 
    if (eventArgs.DialogResult == true)
    {
        if (string.IsNullOrEmpty(scheduleView.EditedAppointment.Subject))
        {
            eventArgs.Cancel = true;
            MessageBox.Show("Subject cannot be empty!");
        
    }
}

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
ITA
Top achievements
Rank 1
answered on 10 Sep 2013, 06:46 AM
Hi,

thanks so much, but i use CustomAppointments. How do i handle this?

thanks
Rene
0
Kalin
Telerik team
answered on 11 Sep 2013, 11:49 AM
Hi Rene,

There shouldn't be any difference whether you are using custom Appointments or not. Could you please give us some more details about the desired scenario and the exact problem you are facing?

I'm looking forward to your reply.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
ITA
Top achievements
Rank 1
answered on 11 Sep 2013, 11:52 AM
Hi,

sorry problem solved: var MyAppointment = scheduleView.EditedAppointment as CustomAppointment;

Thanks
Rene
Tags
ScheduleView
Asked by
ITA
Top achievements
Rank 1
Answers by
Kalin
Telerik team
ITA
Top achievements
Rank 1
Share this question
or