This question is locked. New answers and comments are not allowed.
When I deployed this to the server I get the error of "The value '18/05/1974' is not valid for D.O.B.." when doing in grid editing
My View:
Editor Template Date.ascx
See attached screenshot.
If I input the date in my desired format (dd/MM/yyyy) I get the format validation error.
If I input the date in US format (MM/dd/yyyy) the value is saved and then displayed in the correct dd/MM/yyyy format.
What do I need todo so that I do not get this validation error?
My View:
<%= Html.Telerik().Grid<SDAC.Models.Runner>() .Name("Grid") .DataKeys(keys => { keys.Add(p => p.id); }) .ToolBar(commands => commands.Insert().ButtonType(type).ImageHtmlAttributes(new {style="margin-left:0"})) .DataBinding(dataBinding => { dataBinding.Ajax() .Select("_Select", "Runner") .Insert("_Insert", "Runner") .Update("_Save", "Runner") .Delete("_Delete", "Runner"); }) .Columns(columns => { columns.Bound(o => o.lastname); columns.Bound(o => o.firstname); columns.Bound(o => o.sex).Width(40); columns.Bound(o => o.Active).Width(40); columns.Bound(o => o.dob).Format("{0:dd/MM/yyyy}").Width(100); columns.Command(commands => { commands.Edit().ButtonType(type); commands.Delete().ButtonType(type); }).Width(180).Title("Commands"); }) .Editable(editing => editing.Mode(mode)) .Scrollable(scrolling => scrolling.Enabled(false)) .Sortable(sorting => sorting.Enabled(true)) .Pageable(paging => paging.PageSize(10)) .Filterable(filtering => filtering.Enabled(true)) .Groupable(grouping => grouping.Enabled(true)) .Footer(true)%>Editor Template Date.ascx
<%= Html.Telerik().DatePicker() .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) .HtmlAttributes(new { id = ViewData.TemplateInfo.GetFullHtmlFieldId(string.Empty) + DateTime.Now.Millisecond.ToString() }) .Value(Model > DateTime.MinValue? Model : DateTime.Today) .Format("dd/MM/yyyy")%>See attached screenshot.
If I input the date in my desired format (dd/MM/yyyy) I get the format validation error.
If I input the date in US format (MM/dd/yyyy) the value is saved and then displayed in the correct dd/MM/yyyy format.
What do I need todo so that I do not get this validation error?