Pasting a value in Datepicker

Thread is closed for posting
2 posts, 0 answers
  1. Kaushik
    Kaushik avatar
    6 posts
    Member since:
    Nov 2013

    Posted 11 Mar 2014 Link to this post

    Hello ,

    I am using datepicker in my application, I have set the displaydateformat of that to dd/MM/yyyy

    <tlr:RadDatePicker runat="server" ID="InvoiceDate"   AutoPostBack="false" >
                 <DateInput ID = "invoiceDate" runat = "server" DateFormat = "dd/MM/yyyy" DisplayDateFormat = "dd/MM/yyyy">

    When I select the date from the datepicker calendar it is getting displayed in dd/MM/yyyy format in the datepicker textbox. But when I paste some value in the textbox
    it is getting displayed in mm/dd/yyyy format

    for eg. pasting 2013-03-11 is getting displayed as 03/11/2013, where as I want it to be as 11/03/2013.

    Can you please help me in this.

  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 14 Mar 2014 Link to this post

    Hello Kaushik,

    In case you are pasting a date not in the already set format the RadDatePicker assumes a correct date and set it to the date input.
    In case this is not the date you want to be selected, possible approach is to handle the client OnValueChanging event, cancel it and set the value in the format you need. See the help topic below for more information on this matter:

    Maria Ilieva

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Back to Top