1
我是Kendo UI的新手。我有我的代码如下。如何在Kendo UI中更改网格页面大小的默认值?
@(Html.Kendo().Grid<ETS.Model.CompanyList>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(c => c.CompanyID).Title("Name").Template(@<text>@Html.ActionLink(@item.Name, "Company", "Companies", new { @id = @item.CompanyID }, new { @style = "color:black; text-decoration: none;" })</text>);
columns.Bound(p => p.City).Title("Billing City");
columns.Bound(p => p.SalesRep).Title("Sales Rep");
columns.Bound(p => p.Phone).Title("Company Name");
})
.Pageable(pageable => pageable
.PageSizes(true)
.ButtonCount(5)
.Refresh(true)
)
.Sortable()
.HtmlAttributes(new { style = "height: auto;" })
.BindTo(Model.Companies)
)
默认情况下,网格上显示5个项目。有什么办法可以将默认值更改为20?
你的答案让我改变页面的值,但它没有将20设置为默认值。该值在框中为20,但只显示5个项目。 – MSH
您是否尝试过明确设置DataSource并使用'.DataSource(ds => ds.Server()。PageSize(20))'来查看这是否有所作为? –
这工作完美。非常感谢!! – MSH