Strange behavior: rows_per_page

Hi @gweber.lauraandleigh,

For pagination to work, your DataGrid needs to understand how many rows of data there are in the child component. This system only works if the child component (i.e. RepeatingPanel’s ItemTemplate) inherits from DataRowPanel.

RowTemplates are Forms just like any other Form. All forms inherit from one of the standard Anvil containers (e.g. BlankPanel Forms inherit from ColumnPanel). RowTemplates are Forms that inherit from DataRowPanel, which enable them to integrate with DataGrid columns, perform pagination etc.

This is why rows_per_page works when using a RowTemplate, but not if you use a BlankPanel Form - a RowTemplate inherits from DataRowPanel and can communicate with the DataGrid to tell it how many rows of data it contains.

If you’d rather use a BlankPanel Form inside your RepeatingPanel, you can add a BlankPanel Form to the RowTemplate, and then rows_per_page will work. Here’s a modified version of the clone link you shared, using the RowTemplate, but adding ‘Form2’ to that RowTemplate:

https://anvil.works/build#clone:5MYFMYNH2SQMFUY3=WDFLGGKWRJAZ7DSXPGPGVD6P

3 Likes