Display only datepicker in kendo inline editing not datetime picker
Asked Answered
L

1

5

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?

Lauter answered 6/6, 2014 at 13:9 Comment(0)
L
10

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 :)

Lauter answered 6/6, 2014 at 13:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.