I have the following inline grid with datepicker. The datepicker bind date corretly in database. However if you change the radpicker value then it would not hold the current selected date instead it hold 01/01/1001 00 00 00.
Anybody can help?
VIEW:
@(Html.Kendo().Grid(Model)
.Name("SList")
.HtmlAttributes(new { @Style = "align:center; font-size:10px;" })
.Columns(columns => {
columns.Bound(p => p.CCID);
columns.Bound(p => p.CRN);
columns.Bound(p => p.CFirstName).Width(140);
columns.Bound(p => p.CFamilyName).Width(140);
columns.Bound(p => p.Alias).Width(45);
columns.Bound(p => p.CGender).Width(45);
columns.Bound(p => p.CAge).Width(45);
columns.Bound(p => p.CDOB).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.RDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.RFrom);
columns.Bound(p => p.RComments);
columns.Bound(p => p.ReferralTo);
columns.Bound(p => p.CStatusID).EditorTemplateName("CStatus
");
columns.Bound(p => p.DateScheduled).Format("{0:MM/dd/yyyy}");
columns.Command(commands => commands.Edit()).Width(175);
})
//.ToolBar(toolBar => toolBar.Save())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.Navigatable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single)
.Type(GridSelectionType.Row))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model => model.Id(p => p.ConsumerID))
.Read(read => read.Action("Index", "Management"))
.Update(update => update.Action("Edit", "Management"))
)
)
/Shared/EditorTemplates
DateTime.cshtml
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m)
.Format("M/dd/yyyy"))
Anybody can help?
VIEW:
@(Html.Kendo().Grid(Model)
.Name("SList")
.HtmlAttributes(new { @Style = "align:center; font-size:10px;" })
.Columns(columns => {
columns.Bound(p => p.CCID);
columns.Bound(p => p.CRN);
columns.Bound(p => p.CFirstName).Width(140);
columns.Bound(p => p.CFamilyName).Width(140);
columns.Bound(p => p.Alias).Width(45);
columns.Bound(p => p.CGender).Width(45);
columns.Bound(p => p.CAge).Width(45);
columns.Bound(p => p.CDOB).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.RDate).Format("{0:MM/dd/yyyy}");
columns.Bound(p => p.RFrom);
columns.Bound(p => p.RComments);
columns.Bound(p => p.ReferralTo);
columns.Bound(p => p.CStatusID).EditorTemplateName("CStatus
");
columns.Bound(p => p.DateScheduled).Format("{0:MM/dd/yyyy}");
columns.Command(commands => commands.Edit()).Width(175);
})
//.ToolBar(toolBar => toolBar.Save())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
.Navigatable()
.Selectable(selectable => selectable.Mode(GridSelectionMode.Single)
.Type(GridSelectionType.Row))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model => model.Id(p => p.ConsumerID))
.Read(read => read.Action("Index", "Management"))
.Update(update => update.Action("Edit", "Management"))
)
)
/Shared/EditorTemplates
DateTime.cshtml
@model DateTime?
@(Html.Kendo().DatePickerFor(m => m)
.Format("M/dd/yyyy"))