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

How can I catch invalid entries as ValidationError?

3 Answers 108 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Jerma
Top achievements
Rank 1
Jerma asked on 04 Dec 2009, 05:36 PM
Hello,

I have the following problem: I have a form with a RadDatePicker in it. Everything works fine, but when I enter an invalid date into the entry field of the picker, the date is just resetted or the entry field of the picker is empty. I would prefer to see the defined ErrorTemplate instead.
I tried to catch this by adding ValidatesOnError to the Binding in the XAML file but it doesnt work.

So: How can I catch it if the user enters an invalid value to the entry field?

Best Regards,
Jerma

3 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 09 Dec 2009, 12:28 PM
Hello Jerma,

Can you share a sample of the code that shows the problem you are facing.

Best wishes,
Kaloyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Jane
Top achievements
Rank 1
answered on 19 Jan 2010, 02:11 AM
We see the same problem for the RadDatePicker
If the current date is "18/01/2010" and we type in an invalid value such as "18/21/2010" (there is no month will be 21).
click other control, the RadDatePicker' selection date box will be empty.

For the RadTimePicker, if we type in invalid value such 6:70 (there is no minute exceed 59)
click other control, the RadTimePicker's selection time box will be empty.
is there a way we can indicate some error in UI?
thx!
Jane


0
Kaloyan
Telerik team
answered on 22 Jan 2010, 10:36 AM
Hello Jane,

To achieve such an validation UI logic you need to bind the appropriate properties of the RadDatePicker(SelectedDate) and RadTimePicker (SelectedTime) to a view model data. Also as a simple solution you should define your own validation rule that will be used by the Binding.ValidationRules system. Check the attached example.

Greetings,
Kaloyan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
TimePicker
Asked by
Jerma
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Jane
Top achievements
Rank 1
Share this question
or