若水平方向也要有捲軸必須把所有Column寬度都設定好,否則Telerik會自動以最佳寬度去排列資料,造成資料行無限長~~版面破碎的情況。
設定範例如下
@(Html.Telerik().Grid< mydocument>()
.Name("Grid")
.Columns(columns => {
columns.Bound(o => o.UserName).Width(100);
columns.Bound(o => o.UserId).Width(200);
columns.Bound(o => o.Address).Width(100);
})
.DataBinding(d => d.Ajax().Select("_AjaxBinding", "Home"))
.Scrollable())
參考出處
網址:MVC Grid Horizontal Scrolling
資訊:Horizontal scrolling is enabled automatically in case the total width of the columns exceeds the width of the grid and the Scrollable method is invoked. Make sure you have specified the width of your columns though.