Refreshing the data in a data grid (Selected Rows remain after sync)

Product: PowerShell Universal
Version: 3.9.2

Hi There,

Im having some issues with refreshing the data in a data grid. When I call Sync-UDElement -ID "tablename" it does refresh the data but the selected rows remain from what was previously selected.

I have tried using

Set-UDElement -Id "table" -Properties @{Selection = @()}
Set-UDElement -Id "table" -Properties @{Selection = $null}
Clear-UDelement -Id "table"

None of them clear the selection value. Im using a slightly modified version of the Out-UDSqlDataGrid function shown in the docs, but I cant see anything in there that would cause the selection to be retained.

Im unsure if using a datagrid is the right option or not but I chose it for in line edits which is a big plus for the dashboard I am building for onboarding.

Any help would be greatly appreciated.