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

RadDatePicker Q3 2009 - set_minDate() throws error

2 Answers 39 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Chelsea Leonhart
Top achievements
Rank 1
Chelsea Leonhart asked on 13 Jan 2010, 04:06 AM
Hi Telerik,

I'm using ASP.NET AJAX RadControls Q3 2009 and I got problem with RadDatePicker.

Here is the code

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title>Test Page</title> 
</head> 
<body> 
    <form id="form1" runat="server"
        <telerik:RadScriptBlock ID="RadCodeBlock" runat="server"
            <script type="text/javascript"
                function OnDateSelected(sender, e) 
                { 
                    if(!sender.isEmpty()) 
                    { 
                        var startDate = sender.get_selectedDate(); 
                        var rdpRequestedEndDate = $find("<%= rdpRequestedEndDate.ClientID %>"); 
                         
                        rdpRequestedEndDate.set_selectedDate(startDate); 
                        rdpRequestedEndDate.set_minDate(startDate); 
                    } 
                } 
            </script> 
        </telerik:RadScriptBlock>     
         
        <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
         
        <table> 
            <tr> 
                <td class="tdLabel" style="text-align: right;"
                    <asp:Label ID="lblRequestedStartDateLabel" Text="Requested Start Date:" runat="server" 
                        meta:resourcekey="lblRequestedStartDate"></asp:Label> 
                </td> 
                <td style="text-align: left; "
                    <telerik:RadDatePicker ID="rdpRequestedStartDate"  
                            DateInput-DisplayDateFormat="dd-MMM-yyyy" runat="server" MinDate="<%#DateTime.Now %>"
                        <Calendar ID="Calendar1" runat="server"
                        </Calendar> 
                        <ClientEvents OnDateSelected="OnDateSelected" /> 
                    </telerik:RadDatePicker> 
                </td> 
            </tr> 
             
            <tr> 
                <td class="tdLabel" style="text-align: right; "
                    <asp:Label ID="lblRequestedEndDateLabel" Text="Requested End Date:" runat="server" 
                       meta:resourcekey="lblRequestedEndDateLabel"></asp:Label> 
                </td> 
                <td style="text-align: left; "
                    <telerik:RadDatePicker ID="rdpRequestedEndDate" runat="server" MinDate="<%#DateTime.Now %>" 
                        DateInput-DisplayDateFormat="dd-MMM-yyyy"
                        <Calendar ID="Calendar2" runat="server" Skin="WebBlue"
                        </Calendar> 
                    </telerik:RadDatePicker> 
                </td> 
            </tr> 
        </table> 
    </form> 
</body> 
</html> 

I have two RadDatePicker. The only event is changing the RequestedEndDate on RequestedStartDate_Selected.
If I change the RequestedEndDate first, then change the RequestedStartDate; it will throw an error "Object required" (I use the IE Developer tool to debug the error on IE browser). The Javascript line which makes error seems to be "rdpRequestedEndDate.set_minDate(startDate); ".

Please help me to solve this issue.
Thanks a lot.

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel
Telerik team
answered on 13 Jan 2010, 09:43 AM
Hello Chelsea,

The problem is resolved in the Q3 service pack 1 release of the controls. Please upgrade to that version and let us know if you find any problems with it. You can find more details on how to upgrade here.

Regards,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Chelsea Leonhart
Top achievements
Rank 1
answered on 18 Jan 2010, 02:21 PM
Hi Pavel,

I'm really sorry that I forgot posting my feedback. My project does work fine with the SP1 version.

Thanks a lot.

Tags
Calendar
Asked by
Chelsea Leonhart
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Chelsea Leonhart
Top achievements
Rank 1
Share this question
or