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

Calling a method from a RequiredFieldValidator for RadDatePicker

1 Answer 28 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Pocho
Top achievements
Rank 1
Pocho asked on 18 Feb 2015, 10:38 PM
Hi All,
I have a RadDatePicker control and I need to validate the date. The user must enter a valid date and I have to check the date is not greater that the DataTime.Now value.
I am trying to build a method to handle both cases and send the corresponding error message. It looks I do not have the choice to call a method from the RequiredFieldValidator control.
Do you have any suggestion to handle this case?
Thanks
Yuri.

1 Answer, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 20 Feb 2015, 06:40 AM
Hello Yuri,

You can place RequiredFieldValidator and RangeValidator at the same time. If the value is empty, the RequiredFieldValidator will fire it's message, it there is some inserted value, the RangeValidator will fire.

If you need to apply more complex logic, implement a CustomValidator.

Regards,
Vasil
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Pocho
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Share this question
or