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. Image for the cookie policy date

date format :dd/mm/yyyy

how to getting data from controller(12/2/2015) to view without changing .

1 Reply

PK Prasanna Kumar Viswanathan Syncfusion Team March 16, 2015 11:22 AM UTC

Hi Ganga,

Thanks for using Syncfusion Products.

We analyze your requirement and we suggest you to use format property in the particular date column. Please find the below code snippet

.Columns(col =>

{

col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();

col.Field("CustomerID").HeaderText("Customer ID").Width(80).Add();

col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(75).Add();

col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(75).Format("{0:C}").Add();

col.Field("OrderDate").HeaderText("Order Date").TextAlign(TextAlign.Right).Width(80).Format("{0:dd/MM/yyyy}").Add();

}))

For different types of formats, Please refer below online sample link :

Link : http://mvc.syncfusion.com/demos/web/grid/columnformatting

For your convenience we have created a sample and sample can be downloaded from the below link

Sample Link : http://www.syncfusion.com/downloads/support/forum/118496/Sample118496-1456752423.zip

We have used the jquery globalize to perform those formatting and we can use all the format strings supported by jquery globalize wrapped between “{0” and “}” . And also please check the below link for standard Date and time format strings available.

Link : https://msdn.microsoft.com/en-us/library/az4se3k1%28v=vs.110%29.aspx

Please get back to us if you have any further assistance,

With Regards,

Prasanna Kumar N.S.V


Loader.
Live Chat Icon For mobile
Up arrow icon