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

RadPicker Min date and max date error

0 Answers 74 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Mark de Torres
Top achievements
Rank 1
Mark de Torres asked on 20 Jul 2012, 12:13 AM
Hi Guys,

Here i am getting the following error:

Field record in a database as DateTime field 2012-07-03 00:00:00.000


Value of '3/07/2012 12:00:00 AM' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'. Parameter name: SelectedDate. 

The weird thing is it work the first time and the second or it randomly failed sometime in the second or third attempt.



<telerik:RadDatePicker ID="dtParticipationEnd" runat="server" AutoPostBack="true"
Skin="Office2007" DateInput-DateFormat="dd MMM yyyy"
DateInput-Width="20px" DateInput-CssClass="controlText" DateInput-Enabled="true"
MinDate="01/01/1000" MaxDate="01/01/3000">
</telerik:RadDatePicker>

None the following which i have tried worked. 
 if (this.participationEntity.ParticipationEnd != null)
 {
                    string participationEnd = ((DateTime)this.participationEntity.ParticipationEnd).ToShortDateString();
                    dtParticipationEnd.DbSelectedDate = participationEnd;
 }
 else
 {
                    dtParticipationEnd.DbSelectedDate = null;
  }

Second option i tried:
if (this.participationEntity.ParticipationEnd != null) dtParticipationEnd.DbSelectedDate = this.participationEntity.ParticipationEnd;


No answers yet. Maybe you can help?

Tags
Calendar
Asked by
Mark de Torres
Top achievements
Rank 1
Share this question
or