This is a migrated thread and some comments may be shown as answers.

Pasting a value in Datepicker

1 Answer 49 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Kaushik
Top achievements
Rank 1
Kaushik asked on 11 Mar 2014, 12:09 PM

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">
             </DateInput>
</tlr:RadDatePicker>

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.

Thanks 

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 14 Mar 2014, 12:44 PM
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:
http://www.telerik.com/help/aspnet-ajax/input-client-side-onvaluechanging.html

Regards,
Maria Ilieva
Telerik
 

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

 
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Kaushik
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or