RadDatePicker autocorrect

8 posts, 0 answers
  1. Kazimierz Szadkowski
    Kazimierz Szadkowski avatar
    9 posts
    Member since:
    Sep 2009

    Posted 22 Mar 2010 Link to this post

    I have a problem with autocorrect functionality of RadDatePicker control. When I manually type invalid date '29-02-2010' (no such date this year) it is automatically changed to '28-02-2010', without any notice. It might be confusing for users, so I would rather like to display validation message and let users correct themselves. However, I cannot find a way to turn autocorrection off. I would be most grateful for any tips.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 23 Mar 2010 Link to this post

    Hello,

    Add the following client side code in order to override the built-in date parser engine.

    JavaScript:
     
    <script type="text/javascript">    
        Telerik.Web.UI.RadDateInput.prototype.parseDate = function(value, baseDate)    
        {    
            if (new Date(value) != "NaN")    
                return value;    
        }    
    </script>   

    Hope this helps,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kazimierz Szadkowski
    Kazimierz Szadkowski avatar
    9 posts
    Member since:
    Sep 2009

    Posted 23 Mar 2010 Link to this post

    Works like a charm. Thanks!
  5. Kazimierz Szadkowski
    Kazimierz Szadkowski avatar
    9 posts
    Member since:
    Sep 2009

    Posted 30 Mar 2010 Link to this post

    Unfortunatelly something goes wrong with this solution - when I use the function you suggested some client events of DatePicker and its DateInput are blocked. For example, 'ValueChanging" of DateInput is executed, but "ValueChanged" not. "DateSelected" od DatePicker doesn't work either. How can I deal with this?
  6. Chris Lynch
    Chris Lynch avatar
    5 posts
    Member since:
    Mar 2010

    Posted 30 Mar 2010 Link to this post

    Unfortunately, the date picker control is awful.

    My suggestion is that you abandon Telerik and implement one of these options:

    http://www.codedigest.com/Articles/ASPNET/247_DatePicker_Control_in_ASPNet.aspx

    I suggest the jquery route.

  7. Dimo
    Admin
    Dimo avatar
    8330 posts

    Posted 31 Mar 2010 Link to this post

    Hello all,

    Another discussion on the same topic goes at the following forum thread, where a more in-depth description of the situation is provided:

    http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker-autocorrect-override-othe-forum-posts-not-working.aspx

    Regards,
    Dimo
    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.
  8. Joe
    Joe avatar
    16 posts
    Member since:
    Oct 2013

    Posted 06 Oct 2014 Link to this post

    I have almost the complete opposite of the above problem with the radDatePicker date input. When tabbing away from a GridDateTimeColumn where the column has the following properties:

    <telerik:GridDateTimeColumn HeaderText="Sign Date"
    UniqueName="SignatureDate"  
    DataFormatString="{0:MM/dd/yyyy}"
    EditDataFormatString="MM/dd/yyyy"
    MaxLength="10">
    <HeaderStyle Width="120px" />
    </telerik:GridDateTimeColumn>

    The autocorrect function that I'm assuming is embedded in the Telerik DLL isn't consistently firing. On the Radgrid right above it though, it works correctly. Any idea as to how I can ensure that this fires every time I move away from the GridDateTimeColumn?

    Thanks,

    - Joe
  9. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 09 Oct 2014 Link to this post

    Hello Joe,

    I have replied to your query in the other thread you have posted here. I suggest we continue the conversation there.

    On a side note, please have in mind that it is recommended to avoid submitting duplicate threads. This will allow us to keep better track of your support history an provide better answers quicker.

    Regards,
    Viktor Tachev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

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