【发布时间】:2020-01-14 19:25:49
【问题描述】:
我有以下带有日期选择器的网格:
@(Html.Kendo().Grid<ScheduleViewModel>()
.Name("ScheduleGrid")
.AutoBind(true)
-
)
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Columns(columns =>
{
columns.Bound(s => s.Name).Title("Schedule").Filterable(true).Width(150).HtmlAttributes(new { style = "text-align: left" });
columns.Bound(s => s.StartTime).Width(100).Title("Start Time").ClientTemplate((
@Html.Kendo().DatePicker()
.Name("StartTimePicker")
.Value("#=StartTime#")
//.Format("{0:dd/MM/yyyy}")
.ToClientTemplate()).ToHtmlString());
columns.Bound(s => s.Enabled).Width(100).ClientTemplate("<input type='checkbox' #=Enabled ? checked='checked' : '' # class='sda-checkbox' />").HtmlAttributes(new { @class = "text-center" });
columns.Command(command => command.Custom("Save").Click("saveSchedules")).Width(80).HtmlAttributes(new { @class = "text-center" });
})
但是,日期选择器无法正确显示。相反,它只是一个文本框。我做错了什么?
编辑(我也改用时间选择器而不是日期选择器):
我按照@FrozenButcher 的建议做了,但这仍然不起作用。这就是现在发生的事情:
打开页面,你会得到这个,它看起来不像时间选择器,但确实如此。没有时钟图标,看不到数值:
点击方框,你会得到这个:
显然您现在可以看到时间,但没有时钟图标。
最后,点击第二行的时间选择器,你会得到这个:
非常感谢任何帮助解决此问题。
【问题讨论】:
标签: kendo-ui kendo-grid kendo-datepicker