RadDatePicker's SelectedDate is null but ValidationDate is not

9 posts, 0 answers
  1. Seth
    Seth avatar
    25 posts
    Member since:
    Jan 2009

    Posted 05 Jun 2010 Link to this post

    I have a RadDatePicker control on a form.  If I input a date manually by typing it it and then immediately click on the form's submit button (so the date picker doesn't lose focus until I click on the button), the date picker on the server side doesn't see the newly inputed value. The IsEmpty is set to false and the SelectedDate is null.  However, the ValidationDate property is set to the correct date, but your documentation says not to use this member so I am not.  If I was to tab out of the date picker before clicking on the button, everything works the way it should. How can I validate and consume this control?

    I searched through support for help, but didn't see anything.

    Thanks,
    Seth
  2. Mira
    Admin
    Mira avatar
    1124 posts

    Posted 10 Jun 2010 Link to this post

    Hello Seth,

    I tried to replicate the issue which you described, but to no avail.
    Attached to this message, you will find the code which I used for testing.

    Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.

    Sincerely yours,
    Mira
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. Seth
    Seth avatar
    25 posts
    Member since:
    Jan 2009

    Posted 17 Jun 2010 Link to this post

    Sorry for the delay but vacation called :).

    Ok, so your sample worked for me right out of the box. So I began adding pieces of my design to your sample till I found the culprit.  If you, directly below the script manager reference, add the following line:
    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Buttons" /> 

    so that you end up with this:
        <div> 
            <asp:ScriptManager ID="ScriptManager2" runat="server"
            </asp:ScriptManager> 
            <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Buttons" /> 
            <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
            </telerik:RadDatePicker> 
            <br /> 
            <button type="submit"
                submit</button> 
        </div> 

    You will see that the SelectedDate is null even though the ValidationDate is correct.

    Thanks!
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 22 Jun 2010 Link to this post

    Hello Seth,

    I tested again the application by using the additional information but I’m still not able to replicate the issue. Please find attached the modified project which works correctly on our side.


    Sincerely yours,

    Maria Ilieva
    the Telerik team

     

    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 Public Issue Tracking system and vote to affect the priority of the items
  5. Seth
    Seth avatar
    25 posts
    Member since:
    Jan 2009

    Posted 30 Jun 2010 Link to this post

    I copied your code over and am still getting the same error.  I am using an older version of the Telerik.Web.UI assembly so I removed my reference and added a reference to the one you included with your sample.  However, I still get the same error.  So I then created a web application on a new, clean Windows 2008 R2 machine that has no Telerik installed and has Visual Studio 2010.  This application, using your code and your Telerik.Web.UI assembly, still shows a null SelectedDate when I click on the submit button after manually entering a date into date picker with keystrokes (so the date picker doesn't lose focus until I click on the submit button),  The ValidationDate property is still showing the correctly input date which is making me want to use this property instead so that I can fix this production issue.

    Hopefully this helps you reproduce.

    Thanks mucho!
    Seth
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 05 Jul 2010 Link to this post

    Hello Seth,

    I tested again the provided project locally and I'm still not able to replicate the errors you are facing. Please open a regular support ticket and send us sample runnable application which represents your problem. We will test it locally and advise you further.

    Kind regards,
    Maria Ilieva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  7. Bogey
    Bogey avatar
    4 posts
    Member since:
    May 2007

    Posted 15 Aug 2010 Link to this post

    Has this issuse been resolved?  I'm having a similar issue with the RADCalendar control.  Clicking a date the first time returns selected date in the click event.  Clicking the same date again returns returns 01/01/001 instead of slected date.  Any ideas what may be causing this?

    Thanks
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Aug 2010 Link to this post

    Hi Dan,

    The issue you are facing is actually the default behavior of the control and currently we do not plan to make changes on it. The second select of the same date is actually unselecting it and the control returns the min available date.


    Best wishes,
    Maria Ilieva
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  9. Seth
    Seth avatar
    25 posts
    Member since:
    Jan 2009

    Posted 31 Aug 2010 Link to this post

    Hi Dan,

    Sorry for the delay.  Actually Telerik support was able to figure this one out for us.  This behavior seems to only happen with the html button control.  If you switch over to a asp button or a html input control (type="submit") it should work correctly for you.  At least it worked for us.

    Good luck,
    Seth
Back to Top