I have created a fresh project with the following variables:
I am trying to create a simple grid as following that has an editable `DateTime?` column:
https://netcorerepl.telerik.com/GpFmvpEr29UDYPJN54
It works in the REPL link above, but if I press "Edit" on my local project, the DateTime column defaults to a text input without the datetimepicker buttons (see Attachment-1.png), I'm not sure what I am missing.
I've checked that `/Views/Shared/Editor/Templates/DateTime.cshtml` exists and the content is as follows:
@model DateTime?
@(Html.Kendo().DateTimePickerFor(m => m).HtmlAttributes(new { title = Html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName("")}))I've placed either `[DataType("Date")]` or `[DataType("DateTime")]` annotation on the class property definition and neither worked.
I've used `.EditorTemplateName("DateTime")` and/or `[UIHint("DateTime")]` and it didn't work.
I've created a new Template type and it didn't work.
I'm not sure what else to try to make it work.
In the latest release, 23.1.4, a Date time picker with the DateInput option set fails to be initialized with a jQuery error "s is not a constructor".
This occurs in my code and when using the example from the demo pages https://demos.telerik.com/aspnet-core/datepicker/basic-usage
TagHelper:
<kendo-datepicker name="monthpicker" date-input="true" format="MMMM yyyy" value="DateTime.Now" start="CalendarView.Year" depth="CalendarView.Year" name="monthpicker" style="width: 100%" title="monthpicker"> </kendo-datepicker>
HtmlHelper:
@(Html.Kendo().DatePicker() .Name("monthpicker") .Start(CalendarView.Year) .Depth(CalendarView.Year) .Format("MMMM yyyy") .Value("November 2011") .DateInput() .HtmlAttributes(new { style = "width: 100%", title = "monthpicker" }) )
Both of the above fail to be initialized with the same error. JQuery version 3.3.1 is being used in this case.
Gordon

Afternoon.
I have a MVC Grid with popup editing, created using an example posted on a previous question from me:
https://www.telerik.com/forums/grid-popup-editing-1551548
The popup edit only updates some of the fields in the grid.
I have a datetime field Dateinpost which is set when the record is created - it doesn't need to be updated.
I have set its format in the model:
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
[DataType(DataType.DateTime)]
public DateTime? Dateinpost { get; set; }
It doesn't need to appear on the popup template, but I have included it here so that you can see its value:
<div class="k-edit-field">
@Html.EditorFor(model => model.Dateinpost)
</div>When I update any of the values I get the following ModelState error in the Update action, and the value of Dateinpost in the model is null;
As you can see, the format of the date in AttemptedValue is not correct.
I could write a work around that would clear the ModelState error and not update that field, as it's not to be updated anyway, but it seems that shouldn't be necessary. I've also tried using a date format of "dd/MM/yyyy HH:mm:ss" but that doesn't work either.
Kind regards,
Richard
The user edits dates in a grid in D M Y format .. BUT when saved we see an error that indicates it is expecting M D Y format.
Please see attached files.
<div class="k-form-field">
@(Html.Kendo().TimePickerFor(model => model.Time)
.DateInput()
.Format("HH:mm:ss")
.Interval(15)
.ToClientTemplate()
)
</div>