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

Invalid initial date?

1 Answer 39 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Raymond
Top achievements
Rank 1
Raymond asked on 24 Oct 2017, 05:35 PM

I have a situation where users need to edit previously entered data, which might not be valid.  For example, assume the valid range for an invoice date is the current month (10/1/2017 to 10/31/2017).  Also assume I have an existing invoice with a date outside that range (11/5/2017).  I'd like to present the invalid value to the user, and have the min/max validation force them to fix it. 

Ideally, I could just set the min, max, and selected values in the code behind, and let the client side validation do it's job.  However, setting the selected date to the invalid date in the code behind throws an exception.  I also tried setting the selected date first, then applying the min/max...but then it changes the selected date based on the min/max.  And the InvalidTextBoxValue is read only, so that's not an option.

 

Is there a way to have the initial date value be an invalid value?  I used the example of a date being outside the min/max range...but in our situation it's possible that the original value wouldn't even be a valid date.  Is there anything built into the control that would help with this situation?  One option would be to not use the built in min/max...and implement my own client side validation to do the range check.  But I view that as a last resort.

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 30 Oct 2017, 12:04 PM
Hello Raymond,

I am afraid RadCalendar does not provide this requirement built-in. You can try to hint the user visually by changing the class of this date cell manually:
https://www.telerik.com/forums/calendar-questions#rk4_SG3ajUODfE-WKdhx2Q

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Calendar
Asked by
Raymond
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or