0
votes

I have a Kendo MVC Grid that has a column with a DateTime column. Everything looks good and formats correctly. When i filter, it gives me a date picker and a time picker. When i remove the DateTimeFilter Template below and use template contains, it will give me a Date picker (which i want), but still wants to filter by the date and time.. Is there a way i can have the date and time all as the same field, but only filter with a Date picker.? Example: i use the Date picker to pick 07/24/2017 and it filter everything on that date regardless of time.. Or do they need to be completely different fields, or even concatenated fields in the same column.?

the Column data looks as such: 07/24/2017 18:12:00

columns.Bound(c => c.CreatedDate).Title("Submitted On")
 .ClientTemplate("#= kendo.toString(kendo.parseDate(CreatedDate), 'MM/dd/yyyy HH:mm:ss') #")
 .Filterable(ftb => ftb.Cell(cell => cell.Template("DateTimeFilter")));
1

1 Answers

0
votes

If you're using MVC, in your model, you add DataType.Date above your DatePicker property as below:

[DataType(DataType.Date)]
public DateTime SubmittedOn{ get; set; }

Note: add reference to System.ComponentModel.DataAnnotations if its not included in your header.