Kendo Datepicker在更改月份时显示两个月

时间:2016-08-22 11:01:35

标签: kendo-ui kendo-grid kendo-asp.net-mvc

我的kendo datepicker显示两个月,同时更改日期选择器的月份。请参阅屏幕截图。我找到了以下解决方案Kendo datepicker shows two months during animation。但没有运气。任何人都可以帮忙解决这个问题吗?

enter image description here

我的代码:

@(Html.Kendo().DatePicker().Name("datepicker").Max(DateTime.Today).Events(e => { e.Change("SearchonClick"); }).HtmlAttributes(new { style = "width: 100%", @placeholder = "dd/mm/yyyy", onkeydown = "javascript:return false;" }) ) 

2 个答案:

答案 0 :(得分:0)

观察到的问题肯定是由CSS代码引起的,该代码对弹出日历的table元素强制执行以下样式之一:

/* any other selector that influences Kendo UI Calendar tables */

table {
    width: 100%;
    /* or */
    float: none;
}

Kendo UI Calendar适用并需要以下样式:

.k-calendar .k-content {
    width: 100%;
    float: left;
}

然后,100%宽度样式将被计算的内联像素宽度样式覆盖。

因此,如果非Kendo UI样式覆盖了这两种样式中的任何一种,则日历导航将会中断。请检查并修改您的选择器,以便它们不会以Kendo UI Calendar表为目标。

答案 1 :(得分:0)

最后我找到了答案

bootstrap.css会影响datepicker表。添加以下css是精确解决方案。

 #datepickerid_dateview table.k-content
        {
            border-collapse: inherit;
        }