# Page Size Control

Page size control allows changing the number of items on a page.

```markup
<select data-grid-control="page-size" style="width: 200px">
    <option value="4">4 items per page</option>
    <option value="8">8 items per page</option>
    <option value="12">12 items per page</option>
    <option value="16">16 items per page</option>
    <option value="Infinity">all</option>
</select>
```

| Data Attribute    | Value     | Description                                                                                                                        | Required |
| ----------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------- | -------- |
| data-grid-control | page-size | This attribute defines the control type.                                                                                           | Required |
| data-scroll-top   | no value  | <p>If this data attribute exists, </p><p>the page will scroll to the top each time </p><p>a pagination button will be pressed.</p> | Optional |

#### Initial value

To define the initial page size value, the following setting should be passed to the initialization function:

```markup
<script>
    datagrid({
        pageSize: 12
    });
</script>
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getdatagrid.com/controls/page-size-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
