You can handle the pagination directly and modify the data source you show in the data grid.
It is the same you would do with a column layout.
See here Conflict of "Load More" and frontend filters/search - #4 by dorilama for an example of handling frontend pagination. Instead of columns use data grid. Instead of a “more button” add two buttons to increase or decrease the current page. Be sure to not decrease under 0 or increase above the maximum and change the formulas to account the number of items you want to show on every page (in the example is 3)
Also the documentation has other examples here 📄 Pagination in the Frontend and here 📜 Pagination in the Backend