我正在使用 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");
......
最佳答案
试试这个博客的答案。可能会有帮助。
http://blog.falafel.com/kendo-grid-hierarchy-shared-column-headers/
关于html - Kendo UI MVC4 网格列标题与数据不对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29912138/