# Grid Paging

The Grid component can page the entire data source automatically. Alternatively, you can hook to an event and fetch each page of data yourself.

> caption In this article:

* [Basics](https://www.telerik.com/blazor-ui/documentation/components/grid/paging#basics)
* [Events](https://www.telerik.com/blazor-ui/documentation/components/grid/paging#events)
* [Pager Settings](https://www.telerik.com/blazor-ui/documentation/components/grid/paging#pager-settings)
* [More Examples](https://www.telerik.com/blazor-ui/documentation/components/grid/paging#more-examples)

## Basics

* To enable paging, set the Grid `Pageable` parameter to `true`.
* Set the number of items rendered at once with the `PageSize` parameter (defaults to 10).
* If needed, set the current page of the Grid through its integer `Page` property.
* You can further customize the pager interface via additional [pager settings](https://www.telerik.com/blazor-ui/documentation/components/grid/paging#pager-settings).

> caption Enable paging in Telerik Grid

<demo metaUrl="client/grid/paging/" height="550"></demo>

> note If you want to bind the page index to a variable, you must use two-way binding - the `@bind-Page="@MyPageIndexVariable"` syntax. If you only use one-way binding -  `Page="@MyPageIndexVariable"` - the grid will reset to the value of that parameter on every re-render. If you choose to use one-way binding, you must update the field value in the [`PageChanged` event](https://www.telerik.com/blazor-ui/documentation/components/grid/events#pagechanged) to avoid that.

Here is one way to implement a page size choice that puts all records on one page.

> caption Bind Page Size to a variable

<demo metaUrl="client/grid/paging-page-size/" height="500"></demo>

## Events

The Grid exposes several relevant events. You can find related examples in the [Events](https://www.telerik.com/blazor-ui/documentation/components/grid/events) article.

* `PageChanged` - you can use this to react to the user changing the page.
* `PageSizeChanged` - fires when the user changes the page size via the pager DropDownList.
* `OnRead` - you can use this to perform the read operation yourself on demand, instead of providing the entire data source at once. You can read more about this in the [Manual Data Source Operations](https://www.telerik.com/blazor-ui/documentation/components/grid/manual-operations) article.

## Pager Settings

In addition to `Page` and `PageSize`, the Grid provides advanced pager configuration options via the `GridPagerSettings` tag, which is nested inside `GridSettings`. These configuration attributes include:

<style>
    .article table {
        table-layout: auto;
        word-break: normal;
    }
</style>

| Attribute     | Type and Default Value                              | Description                                                                                                                                                                                                                                                                                                                                                               |
| ------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Responsive`  | `bool` <br/> (`true`)                               | Whether pager elements should change based on the screen size. When enabled, the Pager will hide its `Pager Info` and `PageSize Dropdownlist` if they cannot fit in the available space. In the smallest resolution, the page buttons will be rendered as a select element.                                                                                               |
| `ButtonCount` | `int` <br/> (10)                                    | The maximum number of page buttons that will be visible. To take effect, `ButtonCount` must be smaller than the page count (`ButtonCount < Total / PageSize`).                                                                                                                                                                                                            |
| `InputType`   | `PagerInputType` <br/> (`Buttons`)                  | Whether the pager will show numeric buttons to go to a specific page, or a textbox to type the page index. The arrow buttons are always visible. The `PagerInputType` enum accepts values `Buttons`  or `Input`. When `Input` is used, the page index will change when the textbox is blurred, or when the user hits Enter. This is to avoid unintentional data requests. |
| `PageSizes`   | `List<int?>`                                        | Allows users to change the page size via a DropDownList. The attribute configures the DropDownList options. A `null` item in the `PageSizes` `List` will render an "All" option. By default, the Pager DropDownList is not displayed. You can also set `PageSizes` to `null` programmatically to remove the DropDownList at any time.                                     |
| `Position`    | `PagerPosition` enum <br/> (`PagerPosition.Bottom`) | The position of the Pager. The available options are `Top` and `Bottom`.                                                                                                                                                                                                                                                                                                  |

<demo metaUrl="client/grid/paging-settings/" height="500"></demo>

## More Examples

The following articles and sample projects can be helpful when implementing paging:

* [Capture PageChanged Event](https://www.telerik.com/blazor-ui/documentation/components/grid/events#pagechanged)

* [Server Paging](https://www.telerik.com/blazor-ui/documentation/components/grid/manual-operations) - this article explains how to implement manual data source operations so you can offload the work to the server. It provides the overview of how to setup the grid for that, and examples - several with local data and links a repository with examples using REST API endpoints.

* [How to Increase the DropDownList Width of the Pager](https://www.telerik.com/blazor-ui/documentation/knowledge-base/pager-dropdown-width)

* [How to Integrate Top and Bottom Pager](https://demos.telerik.com/blazor-ui/pager/integration)

## See Also

* [Live Demo: Grid Paging](https://demos.telerik.com/blazor-ui/grid/paging)
* [Blazor Grid](https://www.telerik.com/blazor-ui/documentation/components/grid/overview)
