RadDatePicker Q3 2009 - set_minDate() throws error

3 posts, 1 answers
  1. Chelsea Leonhart
    Chelsea Leonhart avatar
    4 posts
    Member since:
    Nov 2009

    Posted 12 Jan 2010 Link to this post

    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. Answer
    Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 13 Jan 2010 Link to this post

    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.
  3. Chelsea Leonhart
    Chelsea Leonhart avatar
    4 posts
    Member since:
    Nov 2009

    Posted 18 Jan 2010 Link to this post

    Hi Pavel,

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

    Thanks a lot.

Back to Top