# TreeList Paging

The TreeList component offers support for paging.

> caption In this article:

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

## Basics

* To enable paging, set the TreeList `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 TreeList through its integer `Page` property.
* You can further customize the pager interface via additional [pager settings](https://www.telerik.com/blazor-ui/documentation/components/treelist/paging#pager-settings).

Paging is calculated for the currently expanded and visible items. Children in collapsed nodes are not included in the total count and in the current page. Thus, expanding or collapsing a node (row) can change the items you see on the current page.

> caption Enable paging in Telerik TreeList

<demo metaUrl="client/treelist/paging/example-1/" height="720"></demo>

> tip You can bind the values of those properties to variables in the `@code {}` section. If you want to bind the page index to a variable, you must use the `@bind-Page="@MyPageIndexVariable"` syntax.

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/treelist/paging/example-2/" height="720"></demo>

## Events

The TreeList exposes several relevant events. You can find related examples in the [Events](https://www.telerik.com/blazor-ui/documentation/components/treelist/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.

## Pager Settings

In addition to `Page` and `PageSize`, the TreeList provides advanced pager configuration options via the `TreeListPagerSettings` tag, which is nested inside `TreeListSettings`. 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/treelist/paging/example-3/" height="720"></demo>

## See Also

* [Live Demo: TreeList Paging](https://demos.telerik.com/blazor-ui/treelist/paging)
