DataGrid only exports rows in the current page instead of all the rows while exporting as a csv

Product: PowerShell Universal
Version: 3.5.5

Hello everyone,

We’re trying to use a UDDataGrid to output 1000s of results to a Data Grid. However, when we try to export it as a CSV, only the results from the first page are available in the exported csv document. Ideally we would like to have all the rows in the datagrid available in the export.

Has anyone faced this problem? If so please recommend any workarounds.

Really appreciate any help, thanks!

Here’s an example:
Even though there are 100 rows in the datagrid, only the first 5 rows are exported to a csv

The exported CSV looks like this:
image

Here is the powerShell code that we’re using to populate the data-grid (from the PSU docs here

New-UDDataGrid -LoadRows {  
    $Rows = 1..100 | % {
        @{ Name = 'Adam'; Number = Get-Random }
    } 
    @{
        rows     = $Rows | Select-Object -First $EventData.pageSize -Skip ($EventData.page * $EventData.pageSize)
        rowCount = $Rows.Length
    }

} -Columns @(
    @{ field = "name"; }
    @{ field = "number" }
) -AutoHeight -Pagination

I’d recommend using -OnExport