I have a kendo grid that is loaded in a Kendo window. There is a date field in the grid that displays the date as /Date(.......)/
Also looked at the following thread http://www.telerik.com/forums/grid-client-template-and-date-formats, but the solutions provided there didn't work.
e.g. If I used this format:
I end up getting a Invalid template error.
Changing it to:
displayed the date as /Date(1406727900000)/
Here is my grid sample:
The DateOpened field is of DateTime data type.
Also looked at the following thread http://www.telerik.com/forums/grid-client-template-and-date-formats, but the solutions provided there didn't work.
e.g. If I used this format:
columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("#=kendo.toString(DateOpened,'MM/dd/yyyy')#");I end up getting a Invalid template error.
Changing it to:
columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("\\#=kendo.toString(DateOpened,'MM/dd/yyyy'\\)#");displayed the date as /Date(1406727900000)/
Here is my grid sample:
<script type="text/x-kendo-template" id="SeverityDetailsTemplate"> @(Html.Kendo().Grid<TestViewModel>() .Name("TestGrid") .Columns(columns => { columns.Bound(s => s.CategoryId).Visible(false); columns.Bound(s => s.Name) columns.Bound(s => s.District) columns.Bound(s => s.CategoryName) columns.Bound(s => s.DateOpened).Template(@<Text></Text>).ClientTemplate("\\#=kendo.toString(DateOpened,'MM/dd/yyyy')\\#"); columns.Bound(s => s.DateClosed); columns.Bound(s => s.Description); }) .DataSource(ds => ds .Ajax() .PageSize(15) .Read(read => read.Action("GetTestGridDetails", "Home", new { categoryId = "#=CategoryId#" })) .Events(events => events.Error("grid_errorHandler")) ) .Scrollable(s => s.Enabled(false)) .Pageable(page => page.Refresh(false).PageSizes(new[] { 5, 10, 15, 20 })) .Resizable(r => r.Columns(true)) .Sortable() .ToClientTemplate() )</script>The DateOpened field is of DateTime data type.