Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.31 KB

Paging.md

File metadata and controls

38 lines (24 loc) · 1.31 KB

Blazor WASM with GridMvcCore back-end (REST API)

Paging

Index

You must configure the page size in the contructor of the GridServer object in the server project 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 paging 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>(httpClient, url, query, false, "ordersGrid", ColumnCollections.OrderColumns, locale)
            .ChangePageSize(true);

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

<- Keyboard navigation | Custom columns ->