We are using your components for data validation of external data where data might be wrong.
We use DatePickers a lot and we need to set the MinDate and MaxDate when users correct values.
Sometimes the dates is out of range. At the moment I have set the SkipMinMaxDateValidationOnServer="true", but the date is changed when displaying it to min date if the date is below min date. This confuses the users since they don't know the original value of the date and when they see it on the screen they think it is correct and can't understand why the system is complaining about the date since it seems to be within the allowed range.
Is it possible to keep the original value, but display the nice "waring" symbol instead ?
As a "not so nice" workaround at the moment we need to adjust the min date to the invalid date so that the date is not changed.
Regards
Ole Oscar Johnsen
7 Answers, 1 is accepted
Based on the provided description I can not fully understand the exact scenario you are implementing. Generally a simple RadDatePicker with set Min and Max dates does not automatically convert the date to min or the max value when it is out of this range but mostly turns to error mode. Testing the simple markup below presents this behavior:
<
telerik:RadDatePicker
runat
=
"server"
ID
=
"rdp1"
MinDate
=
"7/25/2015"
MaxDate
=
"7/30/2015"
SkipMinMaxDateValidationOnServer
=
"true"
>
</
telerik:RadDatePicker
>
Please do let me know what the exact scenario you are implementing is, so that we can provide proper solution for your specific case.
Regards,
Maria Ilieva
Telerik

Hi,
The main senario is data validation of transactions where other system gives us wrong data since they don't validate the data correctly/don't have validation at all. The data is given mainly through web services or files. We do a extensive validation of these data based on incoming data and/or data already in our systems. If we find some problems with the data we displays it in exception lists and some have to correct/make a decision based on the data. It is big amount of data and often it is approx < 5% of exceptions. In these situations we don't want to reject all data, only correct the exceptions. Often the invalid data is wrong dates. A very simple case is for example that we know that a person was employed on a specific date, but now the other system tells us that payment date is before the employment rate. Often this is because of someone in the other system has changed something so it is invalid.
And then back to the datepicker. If we use MinDate and MaxDate and we set the MinDate to "Employment Date" for payment date and since the payment date is earlier than EmploymentDate it will not be displayed in the DatePicker. The date will be empty with the result that the user can't see the the original value that is not correct according to min date.
Regards
Ole Oscar Johnsen
In this case when the payment date is earlier than EmploymentDate, the RdadatePicker will turns to error mode. In this case you can handle the OnError event and modify the wrong date as needed.
Regards,
Maria Ilieva
Telerik

In SP1 there is a new feature Disabling Autocorrect in RadDateInput. Will this one help in this scenario.
Regards
Ole Oscar Johnsen
There is no Autocorrect property available out of the box for the DateInput control. However, you can implement the behavior manually.
As Maria suggested you can handle the OnError client-side event and adjust the date according to your requirements.
Regards,
Viktor Tachev
Telerik

Hi,
In your document
http://www.telerik.com/support/whats-new/aspnet-ajax/release-history/ui-for-asp-net-ajax-q2-2015-sp1-version-2015-2-729
There is something mention about this.
Input
NEW
Disabling Autocorrect in RadDateInput
The Date picker uses the RadDateInput so i think it will be possible to use it in the DatePicker to. Do you have any information on what this "Disabling of Autocorrect" will do ?
If this one does the works it will be much easier to use this one instead of implementing the OnError logic in code behind on every DatePicker in the application.
Regards
Ole Oscar Johnsen
The feature you are referring to is related to the way the date is parsed by the control. As the user can enter a date manually it should correspond to the defined date format. The new feature introduces the EnableSmartParsing property. It is true by default. Setting the property to false allows the above behavior to be disabled.
With that said, the above feature does not adjust the date in any way. Thus, implementing such behavior would require custom code.
Regards,
Viktor Tachev
Telerik