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

[Solved] Restrict the date selection along with validation

1 Answer 151 Views
DatePicker for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shashank
Top achievements
Rank 1
Shashank asked on 16 Mar 2013, 02:40 PM
Hi telerik,

I want to implement two terelik windows 8 calender to select a date range, One as from date and another as to date. How can I implement the validation such that from date is always greater than equal to to date.

Along with it I want to restrict the date selection between 1.1.1970 to 31.31.2012 for both from and to date calender.

Awaiting for you response.

Thanks,
-Shashank

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 18 Mar 2013, 01:04 PM
Hello Shashank,

Both of your requirements can be accommodated by setting the RadDatePicker.MinValue / MaxValue properties.
First you need to set the general restriction of your range (set RadDatePicker.MinValue to 1/1/1970 and MaxValue to 31/12/2012 for both pickers), then you need to handle the ValueChanged event of the first picker so when its value is changed you need to additionally restrict the range of the second picker (by setting the MinValue property of the second picker to the selected value in the first picker).

Hope this helps.


Regards,
Giuseppe
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DatePicker for XAML
Asked by
Shashank
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or