Reputation: 604
I am working on two already existing ASP.NET Web projects. I got an issue that DateOfBirth is showing in MM/dd/yyyy format instead of dd/MM/yyyy in telerik:RadDatePicker. So i have added following code in both projects.
<div>
<telerik:RadDatePicker RenderMode="Lightweight" ID="StartDate" ClientEvents-OnDateSelected="OnDateSelected" runat="server" Culture="en-US" meta:resourcekey="StartDateResource1">
<Calendar ShowRowHeaders="False" RenderMode="Lightweight" UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False"></Calendar>
<DateInput DateFormat="d/M/yyyy" DisplayDateFormat="d/M/yyyy"
</DateInput>
</telerik:RadDatePicker>
</div>
DisplayDateFormat is working fine in Project-1, but it fails in Project-2. I tried different formats. Also i copied the entire page from Project-1 to Project-2, then also issue persists. I tried the same code in different pages and it always fails in Project-2.
I have verified the .Net framework and Telerik version in both projects and it seems to be the same. Does anyone have idea on this issue?
Upvotes: 2
Views: 612
Reputation: 604
I found answer myself. There was following code snippet in BasePage.cs file
datePicker.DateInput.DisplayDateFormat = CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern;
datePicker.Culture = new CultureInfo(ResourceContext.Culture);
I have removed the above part from code and it is working fine.
Upvotes: 1