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

Open raddatepicker on formload

5 Answers 133 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
JJ
Top achievements
Rank 1
JJ asked on 21 Jun 2011, 08:57 PM
Is there anyway to open raddatepicker on form load?

Thanks

5 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 22 Jun 2011, 10:59 AM
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.

0
JJ
Top achievements
Rank 1
answered on 13 Jul 2011, 06:31 PM
Raddatepicker does not have OnLoad events
0
JJ
Top achievements
Rank 1
answered on 13 Jul 2011, 08:25 PM

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>
-----------------------------------------------------

 

0
Shinu
Top achievements
Rank 2
answered on 14 Jul 2011, 05:19 AM
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.
0
JJ
Top achievements
Rank 1
answered on 17 Jul 2011, 12:59 PM
It works. Thanks!
Tags
Calendar
Asked by
JJ
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
JJ
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or