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

DatePickerFor behavior changes in grid

1 Answer 92 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
montgomery
Top achievements
Rank 1
montgomery asked on 08 Mar 2013, 12:52 AM
We are using Kendo 2012.3..1315.340. Here is the issue. We are using the EditorTemplate for DateTime?, which calls DatePickerFor. This works wonderfully in a standard cshtml view and the POST contains the name/value TransactionDate = "03/19/2013". However, if I use the same view model in a grid and use either inline editing or popup editing I get a POST with TransactionDate = "Tue Mar 19 2013 00:00:00 GMT-0700 (Pacific Daylight Time)". This value does not automatically populate the view model on submission and the date property on the model defaults to DateTime.MinValue. Since this is an identical view model with and identical editor template, does anyone have any ideas on why the POST values are different (and seemingly improperly formatted from the grid)?

1 Answer, 1 is accepted

Sort by
0
montgomery
Top achievements
Rank 1
answered on 08 Mar 2013, 07:08 PM
This was an error caused by converting an existing Telerik MVC 3 app to MVC 4 and Kendo. A reference to jquery that came with MVC 4 was being used without a reference to the jquery that is part of the Kendo script directory. I don't know if this was missing from the Kendo conversion documentation or if I just missed it. This leads to odd behavior in the Kendo controls (as you would expect!) but the errors are subtle. Most of the controls work fine. Hopefully this will be useful to anyone else who has difficulty with a conversion.
Tags
Date/Time Pickers
Asked by
montgomery
Top achievements
Rank 1
Answers by
montgomery
Top achievements
Rank 1
Share this question
or