MVC kendo网格仅在IE中以编辑模式显示完整日期

时间:2016-10-27 18:40:31

标签: asp.net-mvc kendo-grid

当我想在kendo网格中编辑日期时,不要在IE中显示日期时间选择器,而它在Chrome中工作正常

@(Html.Kendo().Grid<Models.Person>().Name("people")
.DataSource(dataSource => dataSource
    .Ajax()
    .Model(model =>
    {
        model.Id(m => m.PersonID);
        model.Field(f => f.Name);
    })
        .Read(read => read.Action("GetPeople", "Home").Data("extraData"))
        .Update(up => up.Action("UpdatePerson", "Home"))

)
.Columns(columns =>
{
    columns.Bound(c => c.PersonID);
    columns.Bound(c => c.Name);
    columns.Bound(k => k.BirthDate).Format("{0:dd.MM.yyyy}");
   columns.Command(cmd => cmd.Edit());
})
.Events(ev => ev.DataBound("db"))
)

see result   我使用ASP.NET5 RC1 MVC

 <script src="~/lib/kendo-ui/js/cultures/kendo.culture.es-MX.min.js"></script>
<script>
    kendo.culture("es-MX");
</script>

模型.....

  public class Person
  {
    public int PersonID { get; set; }
    public string Name { get; set; }
    [DataType(DataType.Date)]
    public Nullable<DateTime> BirthDate { get; set; }

   }

1 个答案:

答案 0 :(得分:0)

我得到了解决方案:) 我添加共享文件夹 - &gt; EditorTemplates - &gt;文件DateTime.cshtml

@model DateTime?
@(Html.Kendo().DateTimePickerFor(m => m))