Product: PowerShell Universal
Version: 5.5.4
Hello,
I have a UDDataGrid component with selectable rows. I try to find a way to deselect all selected elements programmatically.
I tried something like this :
Set-UDElement -Id 'DataGrid' -Attributes @{ Selection = $null }
Sync-UDElement -Id 'DataGrid'
It works but the webUi is not well refreshed because my old selected elements are still checked.
Do you guys have any idea ?
Thanks !
dishi
2
Hello,
I have exactly the same issue, I try to empty my variables, my sessions but same the past selection stays…
If anyone has an idea ?
parzog
4
I haven’t looked at this. Let me cobble together a datagrid and give it a test; I’ll reply back with what I find.
parzog
5
Interestingly, the following button:
New-UDButton -Text "button" -OnClick { $r = (Get-UDElement -Id "DataGrid").selection; Write-Information "r: $(ConvertTo-Json $r)"; Set-UDElement -Id "DataGrid" -Attributes @{ selection = @("selectedRowId") }; Sync-UDElement -Id "DataGrid"; $r = (Get-UDElement -Id "DataGrid").selection; Write-Information "r: $(ConvertTo-Json $r)"; }
Puts the output in the console showing the updated selection value, but the UI does not respond. This is a possible bug. @adam, anything to add?