1 Star 0 Fork 0

XFly-Studio / Grid.Blazor

Create your Gitee Account
Explore and code with more than 6 million developers,Free private repositories !:)
Sign up
Clone or download
Paging.md 1.39 KB
Copy Edit Web IDE Raw Blame History

GridBlazor for ASP.NET Core MVC



You must configure the page size in the contructor of the GridServer object in the service method returning the rows to enable paging:

    var server = new GridServer<Order>(repository.GetAll(), Request.Query,
                true, "ordersGrid", columns, 10);

PageSize is an optional parameter of the GridServer constructor. If you don't want to enable paging you must call the contructor with no parameter:

    var server = new GridServer<Order>(repository.GetAll(), Request.Query,
                true, "ordersGrid", columns);

No configuration for the static page size is required on the GridClient object

Change page size on the Razor page

You can configure the grid to enable changes on page size from the Razor page.

You have to enable paging as shown in the section before.

Then you have to use the ChangePageSize method of the GridClient object on the Razor page:

    var client = new GridClient<Order>(q => orderService.GetOrdersGridRows(ColumnCollections.OrderColumns, q),
            query, false, "ordersGrid", ColumnCollections.OrderColumns, locale)

A user can change the page size writing the new size and pressing the "Tab" or "Enter" keys.

<- Keyboard navigation | Custom columns ->

Comment ( 0 )

Sign in for post a comment