Detail Grid Date Format is Ignored

3 posts, 0 answers
  1. Richard
    Richard avatar
    9 posts
    Member since:
    Feb 2013

    Posted 04 Mar 2013 Link to this post

    I have a hierarchical grid which is rendering fine except that the date formatting for the detail grid is being ignored and a JSON date is being rendered instead.  The same formatting works fine in the Master grid.  Data for the sub-grid comes from a List collection in the object that populates the master.  The data was returned as one List of objects.

    The detail grid renders
    instead of something like
    01/23/2013 04:43 PM
    Here's the code:
    @model IEnumerable<KUI_CS_Test1.ROAMHostSvc.BatchHeader>
        ViewBag.Title = "Kendo UI for MVC (C#) Test App";
    <h2>Batch List</h2>
        .Columns(columns =>
                columns.Bound(b => b.BatchID)
                columns.Bound(b => b.Transmitted_DateTime)
                                        .Format("{0:MM/dd/yyyy hh:mm tt}")
                columns.Bound(b => b.Completed_DateTime)
                                        .Format("{0:MM/dd/yyyy hh:mm tt}")
                columns.Bound(b => b.Created_DTTM)
                                        .Format("{0:MM/dd/yyyy hh:mm tt}")
                columns.Bound(b => b.Created_Emp_Name)
                                        .Title("Created By");
        .Events(e => e.DetailInit("detailInit"))
        .DataSource(dataSource => dataSource
        .Read(read => read.Action("FetchBatchList2", "Home"))
    <script id="transactions" type="text/kendo-tmpl">
                        .Columns( columns =>
                            columns.Bound(t => t.ID)
                                                    .Title("Transaction ID");
                            columns.Bound(t => t.Version)
                            columns.Bound(t => t.TranTypeDisplayText)
                                                    .Title("Tran Type");
                            columns.Bound(t => t.PostingFlagDisplayText)
                                                    .Title("Posting Flag");
                            columns.Bound(t => t.Posting_DTTM)
                                                    .Format("{0:MM/dd/yyyy hh:mm tt}")
                                                    .Title("Posting Date/Time");
                            columns.Bound(t => t.PostingMessage)
                                                    .Title("Posting Message");
    <script type="text/javascript" language="javascript">
        function detailInit(e) {
            var grid = $("#Transactions_" +"kendoGrid");
  2. Frank
    Frank avatar
    2 posts
    Member since:
    Nov 2011

    Posted 22 Sep 2015 Link to this post

    Any solution  for that?
  3. Boyan Dimitrov
    Boyan Dimitrov avatar
    2033 posts

    Posted 24 Sep 2015 Link to this post

    Hello Frank,


    It seems that model property is not defined as DateTime, but as string. If it is defined as DateTime type the value should be parsed and shown properly. 


    Boyan Dimitrov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top