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

Date Format String Not working

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rodney
Top achievements
Rank 2
Rodney asked on 21 Feb 2017, 06:32 PM

I've looked at a number of threads on this but none have fixed my problem. The DateFormatString="{0:dd MMM yyyy}" is not being applied. This is a date field in the database and it is currently being displayed as mm/dd/ 

Here's the column definition:

 

<telerik:GridDateTimeColumn UniqueName="RECORDSTARTDATE" HeaderText="Record Start Date" DataField="RECORDSTARTDATE" ShowFilterIcon="false"
                         DataFormatString="{0:dd MMM yyyy}" DataType="System.DateTime" HtmlEncode="false" ItemStyle-CssClass="center"
                         CurrentFilterFunction="GreaterThanOrEqualTo" HeaderStyle-Width="120px" />

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 24 Feb 2017, 07:41 AM
Hi Rodney,

I've tried the mentioned DataFormatString and it works as expected on my side and displays:
24 Feb 2017

Please make sure that the values kept in the database are of type DateTime. You can run the attached web site sample, apply the property and verify the result.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Rodney
Top achievements
Rank 2
Answers by
Eyup
Telerik team
Share this question
or