Masking in RadDatePicker's dateinput

6 posts, 0 answers
  1. Sachin
    Sachin avatar
    10 posts
    Member since:
    Jan 2009

    Posted 03 Jun 2009 Link to this post

    Hi,

    I want the (default value on load in)rendering in datepicker to be __/__/__ on load, and user should be able to insert dates, without having to enter the '/'. I am using Telerik Q1 2009.

    I learn from the forum that raddatepicker's dateinput had this property which was removed in the later version to apply free form logic.

    In one of the threads, you have explained how to achieve this on blur.

    I would like to do this on load (and not on blur). Is there way to do this, without writing the masking logic in javascript ?

    Thanks & Regards,
    Sachin

  2. Sachin
    Sachin avatar
    10 posts
    Member since:
    Jan 2009

    Posted 04 Jun 2009 Link to this post

    Hi All,

    If there is a javascript to help me achieve this, I'm ok with that too!

    Thanks in advance,
    Sachin
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Veli
    Admin
    Veli avatar
    2002 posts

    Posted 08 Jun 2009 Link to this post

    Hi Sachin,

    We have Code Library article showing you how to replace RadDatePicker's default input box with a regular ASP.NET TextBox control. Starting from that example, I have created a small page demonstrating how to replace the input control of a RadDatePicker with a RadMaskedTextBox control for which you can easily set an input mask.

    The idea is to hide your default input box for the date picker, and bind your custom input control to the picker using client API. You need to handle three points of execution:

    1. When the popup is displayed, we need it below the custom input control
    2. When a date is selected, we need to display its value in the custom input
    3. When a date is entered manually, we need to parse it and set the date picker's selected date

    You can take a look at the sample page and see how this solution works for you.

    Kind regards,
    Veli
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Sachin
    Sachin avatar
    10 posts
    Member since:
    Jan 2009

    Posted 09 Jun 2009 Link to this post

    Many Thanks Veli! This looks good.
    I will try it in my solution and let you know.

    Thanks & Regards,
    Sachin

  6. Sachin
    Sachin avatar
    6 posts
    Member since:
    Aug 2011

    Posted 03 Aug 2012 Link to this post

    Hi Team,

    Would it be possible to have the mask based on the culture applied to the datepicker?
    ex. "/" for US "-" for Portuguese ?

    Regards
    Sachin
  7. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 06 Aug 2012 Link to this post

    Hello Sachin,

    Yes is it possible. You can either set the Mask in the code behind by checking the culture first. Or use the property localization provided in the ASP.

    All the best,
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017