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

Rad DatePicker Max date is only 12/30/2099

6 Answers 376 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Kalyan Thiyagarajan
Top achievements
Rank 1
Kalyan Thiyagarajan asked on 05 Mar 2010, 04:25 PM
Hi Guys,

I am using a Rad Date Picker for AJAX and I am not able to select 12/31/2099 which is the based on requirement. How Can I achieve this?

Regards,
Kalyan

6 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 05 Mar 2010, 09:54 PM
Hello Kalyan,

You can set the desired max date via the corresponding property (MaxDate):
<telerik:RadDatePicker
   ID="RadDatePicker1"
   runat="server"
   MaxDate="01-01-2200">
</telerik:RadDatePicker>

MaxDate Property

Kind regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kalyan Thiyagarajan
Top achievements
Rank 1
answered on 09 Mar 2010, 03:32 PM
Thanks this works Great!
0
Dominic
Top achievements
Rank 1
answered on 09 Aug 2012, 03:31 PM
How do you set Rad DatePicker of attribute Maxdate to always dynamically equal today's date? Please help
0
Princy
Top achievements
Rank 2
answered on 10 Aug 2012, 04:16 AM
Hi Dominic,

Try the following code to set MaxDate of RadDatePicker to today's date.

C#:
RadDatePicker1.MaxDate = DateTime.Today;

Hope this helps.

Regards,
Princy.
0
Dominic
Top achievements
Rank 1
answered on 10 Aug 2012, 07:45 PM
Hello Princy,

I realized that I am working with RadDateInput not radDatePickker. On the page view coding, I am trying to get the attribute Maxdate to accept asp script  Maxdate= "&lt;%# System.DateTime.Today %&gt;"  (&lt;%# = <%# and %&gt;= %> )   

but for some strange reason the script code is not working. Is there another way  to call date into Maxdate attribute using C#  properties within asp script..  PS it cannot take Tostring because it's  property are not defined to the asp server. 


    <td class="tdfv" colspan="3"><telerik:RadDateInput ID="DateOfBirth" runat="server" Skin="Web20" Height="14px" Width="70px" DateFormat="MM/dd/yyyy" MinDate="1880-01-01" MaxDate="&lt;%# System.DateTime.Today %&gt;" ShortYearCenturyEnd="&lt;%# System.DateTime.Today.Year %&gt;" SelectionOnFocus="SelectAll" CausesValidation="True" /></td>

This whole code is in a ascx file.
0
Dominic
Top achievements
Rank 1
answered on 13 Aug 2012, 09:09 PM
I figured it out myself:

Add


dateOfBirth = Page.FindControlRecursively("DateOfBirth") as Telerik.Web.UI.RadDateInput;
                        dateOfBirth.MaxDate = System.DateTime.Today;


to EditPersonPhysicalDetails.ascx.cs file underneath the 'public void LoadData()' Method , under LoadData_Base();


Boy I'm smart!!!!!!!!!!!!!!!!
Tags
Calendar
Asked by
Kalyan Thiyagarajan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Kalyan Thiyagarajan
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or