I've added a kendo date picker as an editor in the grid and when I pick a date and click save changes, I get an sql error message: "SqlDateTime overflow.Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM". (Data type in sql is DateTime2). I think I parsed it in a right format (MM/dd/yyyy), but I'm not sure why its not working. When I manually type it as a string type (e.g. 3/7/2020), it works just fine.
1. Grid column part
columns: [{field: "EffectiveDate", title:"EffDate", template: "#= kendo.toString(kendo.parseDate(data.EffectiveDate, 'yyyy-MM-ddThh:mm:ss'), 'MM/dd/yyyy')#",
width: 50, editor: CustomDatePicker}]
2. Editor part
function CustomDatePicker(container, options) { $('<input required name="' + options.field + '"/>').appendTo(container).kendoDatePicker({ format: "MM/dd/yyyy", max: new Date(), parseFormats: ["MM/dd/yyyy"]});}
3. Controller part -- when I'm debugging, the breakpoint hits here and give an sql overflow
public~
...
DateTime datevalue;
bool? isOk; isOk = DateTime.TryParse(HttpContext.Current.Request.Form["EffectiveDate"].ToString(), out datevalue);
DateTime effectiveDate = datevalue;
...