Open raddatepicker on formload

6 posts, 0 answers
  1. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 21 Jun 2011 Link to this post

    Is there anyway to open raddatepicker on form load?

    Thanks
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 22 Jun 2011 Link to this post

    Hi JJ,

    You should be able to do that intercepting the OnLoad client event of the date picker and invoking its showPopup() method (see this article for reference).

    Best regards,
    Sebastian
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 13 Jul 2011 Link to this post

    Raddatepicker does not have OnLoad events
  5. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 13 Jul 2011 Link to this post

    I use the folloiwng code to pop up raddatepicker. when page load, some times it works,. Most of the time I got javascript error below:
    'null' is null or not an object
    --------------------------------------------
    <%

     

    @ Page Language="C#" AutoEventWireup="true" CodeFile="Test4.aspx.cs" Inherits="Test4" %>

     

    <%

     

    @ 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></title>

     

    </

     

     

    head>

     

    <

     

     

    script type="text/javascript">

     

     

     

    function showpopup() {

     

     

     

    var picker = $find("<%= RadDatePicker1.ClientID %>");

     

    picker.showPopup();

    }

    </

     

     

    script>

     

    <

     

     

    body onload="showpopup()">

     

     

     

    <form id="form1" runat="server">

     

     

     

    <div>

     

     

     

     

    <asp:ScriptManager ID="ScriptManager1" runat="server">

     

     

     

    </asp:ScriptManager>

     

     

     

     

     

    <telerik:RadTextBox ID="rtxtSiteID" Runat="server">

     

     

     

     

     

     

     

    <ClientEvents OnLoad="ShowPopUp" />

     

     

     

     

     

     

     

    </telerik:RadTextBox>

     

     

    <telerik:RadDatePicker ID="RadDatePicker1" Runat="server">

     

     

     

    </telerik:RadDatePicker>

     

     

     

     

    </div>

     

     

     

    </form>

     

    </

     

     

    body>

     

    </

     

     

    html>
    -----------------------------------------------------

     

  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jul 2011 Link to this post

    Hello JJ,

    You can try the same code in the JavaScript function named pageLoad() which is a shortcut for the Sys.Application.load event.
    Javascript:
    <script type="text/javascript">
        function pageLoad()
         {
            var picker = $find("<%= RadDatePicker1.ClientID %>");
            picker.showpopup();
         }
    </script>
    Thanks,
    Shinu.
  7. JJ
    JJ avatar
    147 posts
    Member since:
    May 2010

    Posted 17 Jul 2011 Link to this post

    It works. Thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017