【问题标题】:DateTime formatting on Kendo Grid foreign key columnKendo Grid 外键列上的日期时间格式
【发布时间】:2016-01-19 01:12:56
【问题描述】:

我有一个具有如下外键列的剑道网格...

.Columns(col =>
{
   col.ForeignKey(c => c.ScheduleID, (System.Collections.IEnumerable)ViewBag.schedules, "ID", "EventDate").Title("Date");
})

目前,该列显示为 DateTime,例如“01/18/2016 12:00:00:00 AM”,我希望将其显示为“01/18/2016”。我知道在“绑定”列上,您可以使用 .ClientTemplate 来格式化日期时间字段,但是如何在外键列上做同样的事情?

【问题讨论】:

    标签: datetime kendo-ui kendo-grid


    【解决方案1】:
    .Columns(col =>
    {
       col.ForeignKey(c => c.ScheduleID, (System.Collections.IEnumerable)ViewBag.schedules, "ID", "EventDate").Title("Date").Format("{0:M/d/yyyy}");
    })
    

    【讨论】:

    • 我已经尝试过了,但它不适合我。还有其他建议吗?
    • 我可以看看网格中使用的方法吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-10
    • 2014-02-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多