RadPicker Min date and max date error

1 posts, 0 answers
  1. Mark de Torres
    Mark de Torres avatar
    58 posts
    Member since:
    Jan 2010

    Posted 19 Jul 2012 Link to this post

    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;


Back to Top