代码拉取完成,页面将自动刷新
You can call the Html helper extension with the WithPaging method to enable paging in your view. You can also configure page size and other parameters:
@using GridMvc
@model IEnumerable<Foo>
@await Html.Grid(Model).Columns(columns =>
{
columns.Add(foo => foo.Title);
columns.Add(foo => foo.Description);
}).WithPaging(10).RenderAsync()
In complex cases, you can use your own SGrid object. Set the EnablePaging property to true and use the Pager object to configure paging options in your grid:
public class FooGrid : SGrid<Foo>
{
public FooGrid(IQueryable<TestModel> items) : base(items)
{
Columns.Add(foo => foo.Title);
Columns.Add(foo => foo.Description);
EnablePaging = true;
Pager.PageSize = 10;
}
}
Property name | Property type | Description |
---|---|---|
PageSize | Int32 | Setup the page size for displaying items in the grid |
You can configure the grid to enable changes on page size.
If you use the Html helper extension to create the grid, you have to add the ChangePageSize method to the helper:
@using GridMvc
@model IEnumerable<Foo>
@await Html.Grid(Model).Columns(columns =>
{
columns.Add(foo => foo.Title);
columns.Add(foo => foo.Description);
}).WithPaging(10).ChangePageSize(true).RenderAsync()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。