AppointmentCreated Event - AppointmentDialog stay open

5 posts, 0 answers
  1. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 01 Sep 2013 Link to this post

    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
  2. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 03 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 10 Sep 2013 Link to this post

    Hi,

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

    thanks
    Rene
  5. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 11 Sep 2013 Link to this post

    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 >>
  6. ITA
    ITA avatar
    383 posts
    Member since:
    Aug 2009

    Posted 11 Sep 2013 Link to this post

    Hi,

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

    Thanks
    Rene
Back to Top
UI for WPF is Visual Studio 2017 Ready