【问题标题】:Kendo UI MVC4 Grid Column Header is not aligned with dataKendo UI MVC4 Grid Column Header未与数据对齐
【发布时间】:2015-04-28 06:44:46
【问题描述】:

我正在使用 kendo UI MVC4 助手。我已经为每列设置了固定宽度,但是在加载数据时,数据和标题没有对齐。然后,在重新调整任何列的大小时,所有列都会正确对齐(没问题)。请让我知道加载内容时要调整的任何解决方案。我也在使用分组。

请检查屏幕截图。

加载数据后

调整任何列的大小后

请检查我的 html 助手部分。

.....
.Columns(columns =>
                 {
                     columns.Bound(p => p.EvaluationDT_ID).Hidden(true);
                     columns.Bound(p => p.ItemID).Hidden(true);
                     columns.Bound(p => p.ItemName).Width("160px").HtmlAttributes(new { title = "#= ItemName #" }).Sortable(true);
                     columns.Bound(p => p.Itemcode).Width("80px");
                     columns.Bound(p => p.Brand).Width("90px").HtmlAttributes(new { title = "#= Brand #" });
                     columns.Bound(p => p.Weight).Width("50px").HtmlAttributes(new { style = "text-align: right" }).HeaderHtmlAttributes(new { style = "text-align:left;" });
                     columns.Bound(p => p.UOMCode).Width("50px");
                     columns.Bound(p => p.PackagingName).Width("50px");
......

【问题讨论】:

  • 请参阅此问题提到的解决方案stackoverflow.com/questions/28535967/…
  • 感谢 Amal,上述问题没有可靠的答案,即使我已经尝试了讨论中提到的所有内容,但没有奏效。
  • 由于对列进行分组,kedno 网格体中会出现滚动条,占用空间。我有同样的问题,所以可能滚动条出现是你的问题。
  • 是的。滚动条已经存在。 bcz 我有更多专栏。 css/jquery 中是否有任何解决方案来解决这个问题?

标签: html css asp.net-mvc-4 alignment kendo-grid


【解决方案1】:

试试这个博客的答案。可能会有所帮助。

http://blog.falafel.com/kendo-grid-hierarchy-shared-column-headers/

【讨论】:

  • 我的要求不同。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多