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