Pages - Export Data Grid as CSV

I’d like a user to be able to export the data that is shown in a Data Grid as a CSV.

I’d like to include column headers in this export. Currently you can copy/paste from the data grid, but it does not include headers.