SelectedDate returns null

15 posts, 1 answers
  1. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 29 Apr 2013 Link to this post

    Hi,

    after the last update (2013.1.403.40) we noticed a changed behaviour on the RadDateTimePicker component. If the user does not tab out from the component or goes to another input field before he does a callback the SelectedDate is null.

    I'm pasting in a test project

    Best regards

    Robert

    ASPX

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            Instructions. Change time of the RadDateTimePicker component and press the TEST button.
        </div>
        <div>
            <telerik:RadDateTimePicker ID="rdtpTimeStamp" runat="server">
            </telerik:RadDateTimePicker>
               <hr />
             <telerik:RadTabStrip ID="tsFunctionMenu" runat="server" OnTabClick="tsFunctionMenu_TabClick"
                SkinID="FunctionMenuSkin">
            </telerik:RadTabStrip>
            <hr />
            <asp:Label ID="Label1" runat="server" Text="..."></asp:Label>
            <hr />
        </div>
        </form>
    </body>
    </html>

    CS

    using System;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    using System.Data;
    using System.Configuration;
    using System.Web.Security;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Telerik.Web.UI;
     
    public partial class Default : System.Web.UI.Page
    {
     
        protected void Page_Init(object sender, EventArgs e)
        {
            RadTab tab = new RadTab("TEST", "TEST");
            tsFunctionMenu.Tabs.Add(tab);
        }
     
        protected void Page_Load(object sender, EventArgs e)
        {
            Add("<hr>");
            Add("Page_Load");
            Add(String.Format("Date: {0}", rdtpTimeStamp.SelectedDate));
     
            if (!IsPostBack)
            {
                rdtpTimeStamp.SelectedDate = DateTime.Now;
            }
        }
     
        protected void tsFunctionMenu_TabClick(object sender, RadTabStripEventArgs e)
        {
            RadTabStrip ts = (RadTabStrip)sender;
            ts.SelectedIndex = -1;
     
            string cmd = e.Tab.Value;
     
            Add(String.Format("TabClick: {0}", cmd));
     
        }
     
        protected void Add(string text)
        {
            Label1.Text += "<br>" + text;
        }
        protected void Add(string text, object o)
        {
            Add(String.Format(text, o));
        }
     
     
    }


  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 01 May 2013 Link to this post

    Hello Robert,

    This issue was fixed in the Service Pack, please upgrade and let us know if you have any problems.

    Greetings,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 03 May 2013 Link to this post

    Just downloaded SP 2 (2013.1.417.40), but the error is still there...

    Best Regards

    Robert
  5. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 06 May 2013 Link to this post

    The problem has unfortunatly escalated and we now also have seen a similar problem with RadNumericTextBox. If the user does not leave this field (by using tab or entering another field) - the point/comma sign vanish!

    If you need I can send you additional code to verify the behaviour (IE 10) but I think you must already be aware of this behaviour.

  6. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 08 May 2013 Link to this post

    Hello Warnestam,

    I see the problem here, and we will try to resolve in our future versions.
    Currently as workarownd you can attach onclick of the TabStrip and to focus any other element of the page, that will trigger blur of your RadDateInput and the data will be submitted correctly.

    Kind regards,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 13 May 2013 Link to this post

    Thanks for yourt suggestion, but unfortunatly this solultion is not possible with a live web place with many aspx pages and many RadDateInput and RadNumericTextBox components.

    We upgraded to SP1 to get rid of a similar problem regarding RadTextBox on Windows Phone devices.

    1) When do you estimate to have a fix for the problem?
    2) Is the orginial Q1 2013 available for download and if so where can I do it?

    2013-05-14 Update
    I tried Teleriks suggestion to manually focus another element before doing the postback. I added java for the OnClientTabSelecting on my menu (a RadTabStrip) but this change did not solved the problem.

    Please Telerik - can you give us a hint when you estimate to have a solution for the problem!

    Best regards

    Robert
  8. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 14 May 2013 Link to this post

    Ok, I have a fix for the problem but is really ugly and I hope that someone at Telerik soon can reply on my questions


    1) When do you estimate to have a fix for the problem?
    2) Is the orginial Q1 2013 available for download and if so where can I do it?

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <head runat="server">
        <title></title>
        <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    </head>
    <body>
        <form id="form1" runat="server">
        <script type="text/javascript">
     
            function MyDummyFocus() {
                var id = "<%=tbPrice.ClientID %>"
                var cmp = $get(id);
                cmp.focus();
                cmp.blur();
            }
     
        </script>
     
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <div>
            Instructions. <br />
            1) Change time of the RadDateTimePicker component and press the TEST button.<br />
            2) Enter a decimal number (in swedish environment i entered "12,34")
     
        </div>
        <div>
            <telerik:RadDateTimePicker ID="rdtpTimeStamp" runat="server">
            </telerik:RadDateTimePicker>
            <telerik:RadNumericTextBox ID="tbPrice" runat="server" >
            </telerik:RadNumericTextBox>
               <hr />
             <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click"
                Text="RadButton">
            </telerik:RadButton>
             <telerik:RadTabStrip ID="tsFunctionMenu" runat="server"
                   OnTabClick="tsFunctionMenu_TabClick"
                     
                    OnClientMouseOver="MyDummyFocus"             
                SkinID="FunctionMenuSkin ">
            </telerik:RadTabStrip>
            <hr />
            <asp:Label ID="Label1" runat="server" Text="..."></asp:Label>
            <hr />
        </div>
        </form>
    </body>
    </html>
  9. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 14 May 2013 Link to this post

    I have a fix for the problem, but it is an ugly one involving setting focus during the MouveOver event.

    Please Telerik give us feedback on;

    1) When do you estimate to have a fix for the problem?
    2) Is the orginial Q1 2013 available for download and if so where can I do it?

    Best regards

    Robert
  10. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 15 May 2013 Link to this post

    Hi Robert,

    We reed all posts, don't need to repeat yourself. We will do anything possible to fix this for our upcoming Q2 2013 release.
    About the download, I could not say in the forums, it depend on your license and so on. You can contact our sales department and they will help you to get the previous version.

    Regards,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  11. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 15 May 2013 Link to this post

    Sorry for the double post but your site did not operate well yesterday. When I was trying to att my code-block and save the post, the page returnes and the thread untouched.

    I used the GAC to restore the Telerik dll's and tried it with Q1 2013 (both original, SP1 and SP2) and recreated the error on all versions. The previous version that we used and where our pages behaved as predicted was in Q1 2011 (2011,3,1115,40).

    To sum up the error:

    Telerik version: Q1 2013
    Browser where the problem is found: IE 9, IE 10, Firefox 19, Opera 12
    Browser where the problem is NOT found: IE 6, IE 7, IE 8, Chrome 26, 
    Component: RadDateTimePicker and RadNumericTextBox
    Description: Using the above components together with RadTabStrip (and perhaps other componts that uses callback) without first leaving the component results in data loss. For the RadDateTimePicker the date disappears and in the RadNumericTextBox the decimal point disappear.
    Work around: Use the OnClientMouseOver event on the RadTabStrip (Telerik suggested the OnClick event which does not exists) and bluring the component

    Now you have a detailed description of the error, let us hope that I get fix in Q2 2013

    Kind regards

    Robert






  12. Eyup
    Admin
    Eyup avatar
    3012 posts

    Posted 21 May 2013 Link to this post

    Hello Robert,

    Thank you for bringing this problem to our attention. The problem will be forwarded to our developers who will fix it for the future releases. However, please note that we are not able to predict a strict deadline.

    I have updated your Telerik points for bringing the problem to our attention. Sorry for any inconvenience caused.

    Kind regards,
    Eyup
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  13. Frank
    Frank avatar
    24 posts
    Member since:
    Nov 2010

    Posted 31 Jul 2013 Link to this post

    Hi Eyup,

    We allso noticed this bug in our application after upgrading from 2013.1.305.40 to SP1 . Since we trigger the postback using __doPostBack('rbSave', '') there's no momentum where we can switch focus.

    Has this allready been fixed in a newer version ?
    And what happens when your account has recently expired ?
    We should have access to 2013.SP2, but that one (and SP1 aswell) brings in this bug which makes updating impossible...

    Yours
  14. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 22 Mar Link to this post

    We now have the work around in our code for three years. Yesterday we had another problem that arrises when we use the workaround to set focus on the DateTimePicker object and the blur it. If the control is not fully visible in the browser the focus() method will move the entire window causing the initial click on the TabStrip to fail.

    Is there a reasoni that this problem is still not fixed?

    Kind regards

     

    Robert

  15. Answer
    Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 22 Mar Link to this post

    Hello Robert,

    It works correctly in the latest version (Q1 2016 SP1). Could you remove the workaround and test it?

    If you continue to have problems, please give us more details about your current configuration.
    Sample page would be helpful, as well as information if you are using Lightweight render mode or Classic. What is the version of .NET and your Browser.

    Regards,
    Vasil
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  16. Warnestam
    Warnestam avatar
    83 posts
    Member since:
    Sep 2006

    Posted 22 Mar in reply to Vasil Link to this post

    Thanks Vasil,

     

    Updated the components from Q4 2015 to Q1 2016 solved the problem.

     

    Thanks

     

    Robert

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017