2015-04-28 65 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

回答