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

Keep AppointmentDialog open on error

5 Answers 66 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 31 Mar 2011, 02:48 PM
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

5 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 06 Apr 2011, 01:08 PM
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
0
Michael
Top achievements
Rank 1
answered on 06 Apr 2011, 02:07 PM
Hello Yana,

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

best regards,

michael
0
Yana
Telerik team
answered on 04 May 2011, 02:44 PM
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
0
Fernando
Top achievements
Rank 1
answered on 25 Jul 2013, 04:07 PM
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
0
Yana
Telerik team
answered on 29 Jul 2013, 02:28 PM
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 >>
Tags
ScheduleView
Asked by
Michael
Top achievements
Rank 1
Answers by
Yana
Telerik team
Michael
Top achievements
Rank 1
Fernando
Top achievements
Rank 1
Share this question
or