2015-04-28 59 views
4

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

请检查屏幕截图。

加载数据

enter image description here

后重新上浆任何列刚过 enter image description here

请检查我的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"); 
...... 
+0

请参阅这个问题http://stackoverflow.com/questions/28535967/how-to-set-column-width-to-autofit-in-kendo-grid-mvc –

+0

提到的解决方案谢谢Amal,对于上述问题没有可靠的答案,即使我已经尝试过所有在讨论中提到的内容,但都无法正常工作。 – Razack

+0

由于分组列,滚动条会出现在kedno网格体中,并占用空间。我有同样的问题,所以可能是滚动条来的是你的问题。 – 111

回答