Kendo ui 剑道MVC-网格中需要日期选择器

Kendo ui 剑道MVC-网格中需要日期选择器,kendo-ui,kendo-grid,kendo-datepicker,Kendo Ui,Kendo Grid,Kendo Datepicker,我有以下带有日期选择器的网格: @(Html.Kendo().Grid<ScheduleViewModel>() .Name("ScheduleGrid") .AutoBind(true) - ) .Editable(editable => editable.Mode(GridEditMode.InCell)) .Columns(columns => {

我有以下带有日期选择器的网格:

 @(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" });
        })
@(Html.Kendo().Grid())
.Name(“ScheduleGrid”)
.AutoBind(真)
-
)
.Editable(Editable=>Editable.Mode(GridEditMode.InCell))
.列(列=>
{
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(“开始时间”).ClientTemplate((
@Html.Kendo().DatePicker()
.名称(“StartTimePicker”)
.Value(“#=开始时间”)
//.Format(“{0:dd/MM/yyyy}”)
.ToClientTemplate()).ToHtmlString();
columns.Bound(s=>s.Enabled).Width(100).ClientTemplate(“”).HtmlAttributes(新的{@class=“text center”});
columns.Command(Command=>Command.Custom(“Save”).Click(“saveSchedules”)).Width(80).HtmlAttributes(new{@class=“text center”});
})
但是,日期选择器不能正确显示。相反,它只是一个文本框。我做错了什么

编辑(我还切换到使用时间选择器而不是日期选择器):

我按照@FrozenButcher的建议做了,但这仍然不起作用。这就是现在发生的事情:

打开页面,你们会看到这个,它看起来不像一个时间选择器,但却是。没有时钟图标,您无法看到值:

在框中单击,您会看到:

很明显,您现在可以看到时间,但没有时钟图标

最后,单击第二行上的时间选择器,您将看到:


非常感谢您在解决此问题时提供的任何帮助。

您必须确保输入的ID是唯一的,datepicker的包装器是通过name属性定义的


将其更改为动态名称
.name(“StartTimePicker”+行号)

您必须确保输入的ID唯一,datepicker的包装器是通过name属性定义的


将其更改为动态名称
.name(“StartTimePicker”+行号)

谢谢。在上面的编辑中,我描述了现在发生的事情。添加了一个唯一的名称后,情况有所好转,但我仍然有问题。谢谢。在上面的编辑中,我描述了现在发生的事情。添加一个唯一的名称会使情况好转,但我仍然有问题。