Do you know the maximum number of results you will get in the datagrid or templategrid? If so, you could determine how many would fit onto one page, and put a table in your doc template with two rows for each 'set' of results. The first row would show the data/template grid, the second row would have a page break. You can then make these table rows visible or not based on whether you need them.
For instance, if you determine that you will have at most 100 rows of data and 20 rows will fit on a page, you would need a table with 10 rows, 5 datagrids/templategrids and 5 page breaks.
Not the most tidy solution, but I have something like this working currently.
Maybe someone has a nice custom solution but no there's not a regular way to achieve this, the datagrid is rendered as a table internally and has no support for writing certain parts of it across multiple pages.
No, the datagrid in a document template will not repeat its headers when the pages overflow.
I suggest you file a feature request for this.
In addition to Mike's answer: If you have a variable amount of rows a single template grid can also do the job. To stick with Mike's example (20 rows on a page): for each "rownumber-1 mod 20 == 0" row set a boolean: "showHeaders".
Add just one template grid (1 column, 1 row) to the document template and create a table record for the data row. Also make a header row that's conditionally visible on the showHeaders property.
Not tested this solution but I think this should work if you know how much records go on a page.
I created a table in the header with the column headers in it and then in the main body I have the data grid. This allows the header to be on each page.