Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display only datepicker in kendo inline editing not datetime picker

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?

like image 911
Jayakaran Theivendramoorthy Avatar asked Jun 06 '14 13:06

Jayakaran Theivendramoorthy


Video Answer


1 Answers

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

like image 152
Jayakaran Theivendramoorthy Avatar answered Sep 26 '22 19:09

Jayakaran Theivendramoorthy