Display only datepicker in kendo inline editing not datetime picker

不问归期 提交于 2019-12-10 14:12:01

问题


I have an issue to disply the datepicker in kendo inline editing. It shows datetime picker all the times.

columns.Bound(k => k.datefrom).ClientTemplate("#= (datefrom == null) ? ' ' : kendo.toString(datefrom, 'dd.MM.yyyy') #").Width(150);

I also tried like this also

columns.Bound(k => k.datefrom).ClientTemplate("#= (datefrom == null) ? ' ' : kendo.toString(datefrom, 'dd.MM.yyyy') #").Format("{0:d}").Width(150); 

Any idea?


回答1:


You need to specify the Model Property strictly to Date in View model using Data Annotations. In your view model,

[DataType(DataType.Date)] // making data type as date     
public Nullable<System.DateTime> datefrom { get; set; }

And in Kendo Grid,

columns.Bound(k => k.datefrom).Format("{0:dd.MM.yyyy}")

It works now :)



来源:https://stackoverflow.com/questions/24082665/display-only-datepicker-in-kendo-inline-editing-not-datetime-picker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!