Keep AppointmentDialog open on error

6 posts, 0 answers
  1. Michael
    Michael avatar
    18 posts
    Member since:
    Aug 2010

    Posted 31 Mar 2011 Link to this post

    Hi,

    I'm using the appointment dialog for creating and editing appointments. I want to inform the user about errors in the dialog. For example if he did not fill out the subject text box. I could catch the AppointmentSaving event, but at this time the dialog has already been closed. I want to inform the user before the dialog has been closed so he can make changes in the dialog. How can I achieve this?

    thanks in advance,

    michael
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 06 Apr 2011 Link to this post

    Hello Michael,

    We are currently working on an example that demonstrates how to implement validation in
    EditAppointmentDialog. I'll attach the project here as soon as it's ready. Thank you for your patience.

    Greetings,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael
    Michael avatar
    18 posts
    Member since:
    Aug 2010

    Posted 06 Apr 2011 Link to this post

    Hello Yana,

    thanks for your answer. I'm looking forward to the example.

    best regards,

    michael
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 04 May 2011 Link to this post

    Hello Michael,

    We're so sorry for the delay.

    I've attached an example demonstrating the needed validation. Please download it and give it a try.
    Hope this helps.

    Greetings,
    Yana
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Fernando
    Fernando  avatar
    5 posts
    Member since:
    Jan 2013

    Posted 25 Jul 2013 Link to this post

    Hi there,

    The sample code you provide has helped me, but is there any way to send messages to the user such as a message box or a label informing the user about different validations scenarios

    Thanks in advance

    Fernando
  7. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 29 Jul 2013 Link to this post

    Hello Fernando,

    Currently validation tooltips are not supported in RadControls for WPF, however we're working on this task and hopefully they will be available in the upcoming Q3 release.

    For now you can add validation messages inside CustomAppointment class:

    public string ValidateSubject()
    {
        this.IsValid = !String.IsNullOrEmpty(this.Subject);
        if (String.IsNullOrEmpty(this.Subject))
        {
            return "Subject cannot be empty";
        }
        return null;
    }

    and then in the Ok button click event show a MessageBox with the error:

    private void RadButton_Click(object sender, RoutedEventArgs e)
    {
        if (String.IsNullOrEmpty(app.Error))
        {
            RadScheduleViewCommands.CommitEditAppointment.Execute(app, this.scheduleView);
            (sender as RadButton).ParentOfType<RadWindow>().Close();
        }
        else
            MessageBox.Show(app.Error);
    }

    I hope this helps.

    Regards,
    Yana
    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 >>
Back to Top
UI for WPF is Visual Studio 2017 Ready