This is a migrated thread and some comments may be shown as answers.

Popup Editing with DateTime can not be saved

4 Answers 269 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 30 Mar 2015, 05:48 PM
In your sample: http://www.kendoui.com/code-library/mvc/grid/custom-popup-editor.aspx

When I want to save I get an error that the field birthdate must be a date.

I even set DataType.Date annotation on that model property. But still I get this error.

How can I fix your broken sample?

4 Answers, 1 is accepted

Sort by
0
Andreas
Top achievements
Rank 1
answered on 30 Mar 2015, 07:46 PM
It seems when I once set a date via datepicker then I can save and do not get an invalid modelstate.

Why is that?
0
Andreas
Top achievements
Rank 1
answered on 30 Mar 2015, 07:50 PM
Odd... that seemed only to work once, when I tried to submit my form again and changing the dates before still I can not submit the form as the dates are invalid...
0
Andreas
Top achievements
Rank 1
answered on 30 Mar 2015, 09:20 PM
could it be that is a culture problem?
0
Petur Subev
Telerik team
answered on 02 Apr 2015, 07:42 AM
Hello Andreas,

Indeed the issue seems to be caused by difference in the format and the validation. By default if you change the format of a widget the validation will still use the culture information and validate against it. Similar question here:

http://stackoverflow.com/questions/28604114/kendovalidator-causes-the-field-xxx-must-be-a-date-error-when-using-datepick

In order to tell where exactly the issue is coming from please demonstrate your case with a small demo. Thank you for the understanding.

Kind Regards,
Petur Subev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Grid
Asked by
Andreas
Top achievements
Rank 1
Answers by
Andreas
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or