RadDateTimePicker not working after partial postback

2 posts, 0 answers
  1. Dipen
    Dipen avatar
    10 posts
    Member since:
    Jan 2012

    Posted 16 Sep 2015 Link to this post

    RadDateTimePicker is not working after ajax call, only if rad datetimepicker is open time of response back from server. i am also attaching ASPX and CS code

     Step to replicate.

    1. Create new page
    2. Add two datetimepicker
    3. add date change event
    4. Add Ajax panel
    5. put debug pointer on selecteddatechnage event
    6. select date from first datetimepicker
    7. now code will stop in break point
    8. now open second datetimepicker
    9. Go to CS page and Release code from debug point
    10.  Now open second datetimepicker
    11. Now date selection, Month selection will not work

    Thanks,

     

     ASPX

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TestRadDateTimePickerPostBack._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></title>
    </head>
    <body>
        <form id="form1" runat="server">
         <telerik:RadScriptManager ID="ScriptManager1" runat="server">
             <Scripts>
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"></asp:ScriptReference>
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"></asp:ScriptReference>
    <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:ScriptReference>
    </Scripts>
        </telerik:RadScriptManager>
        <telerik:radajaxmanager id="RadAjaxManager1" runat="server" 
            onajaxrequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="panel1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:radajaxmanager>
        
        <script language="javascript" type="text/javascript">

        <telerik:radscriptblock id="RadScriptBlock1" runat="server">
                    function InitiateAjaxRequest() {
                        var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                        ajaxManager.ajaxRequest('RebindCard');
                    }
                    
                    
                    function Expensereport_PeriodFrom_OnDateSelected(sender, args) {
                        
                            InitiateAjaxRequest();
                    }
                    function Expensereport_PeriodTo_OnDateSelected(sender, args) {
                        InitiateAjaxRequest();
                    }
                    
        </telerik:radscriptblock>
        </script>
        
        
        <asp:Panel ID="panel1" runat="server">
            <div class="form-group form-group-sm">
                <asp:Label runat="server" CssClass="control-label col-sm-3 " ID="lbl_Expensereport_PeriodFrom"
                    AssociatedControlID="Expensereport_PeriodFrom" Text="From"></asp:Label>
                <div class="col-sm-3 col-md-3">
                    <telerik:raddatepicker id="Expensereport_PeriodFrom" runat="server" calendar-showrowheaders="false"
                        width="100%" cssclass="requiredText">
                                        <DateInput EnableSingleInputRendering="false" DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"
                                            ReadOnly="true" SelectionOnFocus="CaretToBeginning" />
                                        <DatePopupButton  />
                                        <ClientEvents OnDateSelected="Expensereport_PeriodFrom_OnDateSelected" />
                                    </telerik:raddatepicker>
                </div>
                <asp:Label runat="server" CssClass="control-label col-sm-2 col-md-2 col-lg-1 " ID="lbl_Expensereport_PeriodTo"
                    AssociatedControlID="Expensereport_PeriodTo" Text="To"></asp:Label>
                <div class="col-sm-3 col-md-3">
                    <telerik:raddatepicker id="Expensereport_PeriodTo" runat="server" width="100%" cssclass="requiredText"
                        calendar-showrowheaders="false">
                                        <DateInput EnableSingleInputRendering="false" DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"
                                            ReadOnly="true" SelectionOnFocus="CaretToBeginning" />
                                        <DatePopupButton ToolTip="" />
                                        <ClientEvents OnDateSelected="Expensereport_PeriodTo_OnDateSelected" />
                                    </telerik:raddatepicker>
                </div>
                <div class="clearBoth">
                </div>
            </div>
        </asp:Panel>
        </form>
    </body>
    </html>

     

     C#

    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
            {

                for (int i = 1000; i <= 1000; i++)
                {
                    i++;
                }
               
            }

  2. Daniel
    Admin
    Daniel avatar
    4946 posts

    Posted 21 Sep 2015 Link to this post

    Hello Dipen,

    I'm not able to reproduce the problem at my side. I can't even get to the last step because Internet Explorer don't let me open the second RadDateTimePicker as per step 8. It seems that I'm missing something.

    Regards,
    Daniel
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top