We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem with DateTime Format

Thread ID:





116474 May 30,2014 06:25 PM UTC Jun 2,2014 07:18 AM UTC ASP.NET MVC 4
Tags: Grid
Rick Thompson
Asked On May 30, 2014 06:25 PM UTC

VS 2013

Dates are not formatting correctly in the grid. I have the following in my .cshtml file:

  col.Field("DueDate").HeaderText("Due Date").TextAlign(TextAlign.Center).Width(130).Format("{0:MM/dd/yyyy}").Add();

I've also tried without the .Format
  col.Field("DueDate").HeaderText("Due Date").TextAlign(TextAlign.Center).Width(130).Add();

Either way the output in the column is something similar to this:


I've tried defining the DueDate property two different ways as well:

        // Nullable
public DateTime? DueDate

and also 

        // Not Nullable
public DateTime DueDate

I've tried with frameworks 4.5 and 4.51 and the results are the same. Thinking is was something in my VS project I tried another project I had recently created for some simple testing, the results were the same when I tried to display a date.

Both projects were created using the Syncfusion template in VS 2013 (Syncfusion ASP.NET MVC Application) (NOT the classic version)



Rick Thompson
Replied On May 30, 2014 07:12 PM UTC

As an example I've attached a new project using the Syncfusion MVC template.

This is what I've done to the new project:

  • Added a new file in the Models folder named TestGridModels.cs. This file contains one class and the class has two properties: Name, and HireDate.
  • Added a new View named TestGrid.cshtml containing a very simple grid with columns Name and HireDate.
  • To the Home Controller I've added a new action named TestGrid which returns a list with two items.
  • To _Layout.cshtml I added a link so the new view can be selected.
  • Removed the following NuGet packages related to Owin: Facebook, Google, MicrosoftAccount. I did this to try and get the zip file smaller, didn't help much.



Attachment: TestSfMVC_a252737a.zip

Jesus Sanchez
Replied On May 30, 2014 08:15 PM UTC

The example does not work, follow out/date (1401048779457) /.

Have I too... waiting for a solution this problema


Jesus Sanchez
Replied On June 1, 2014 06:15 AM UTC


Edit web.config and change the entry:
    <add key="UnobtrusiveJavaScriptEnabled" value="false" />


Madhu Sudhanan P [Syncfusion]
Replied On June 2, 2014 07:18 AM UTC

Hi Jesus,

The ASP.Net MVC Controls will render in two mode, they are


·         Unobtrusive mode.

·         Non-unobtrusive mode.


The ASP.Net MVC Controls will render in Unobtrusive mode when setting the “UnobtrusiveJavascriptEnabled” as true in web.config file.



    . . . .

    <add key="UnobtrusiveJavaScriptEnabled" value="true" />




 We have analyzed the code snippet and suspect that this issue had arose in unobtrusive mode.


We confirmed “Date type column values not displayed in specified format in Unobtrusive configured project” as a defect and the fix for this issue, had been included in our Volume 1, 2014 Service Pack 1 ( release itself. And hence we suggest you to upgrade to our latest Volume 1, 2014, Service Pack 2 ( which is available in the below link.


MVC Link: http://www.syncfusion.com/downloads/mvc-service-packs


The above link contains both the Volume 1, 2014 Service Pack 1 and 2 and the fix for this issue is available in both of them.


Please let us know if you have any queries.



Madhu Sudhanan. P


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon