ironmansoftware / powershell-universal

Issue tracker for PowerShell Universal
https://powershelluniversal.com
34 stars 2 forks source link

The Data Grid filters do not function correctly for columns that contain spaces #3432

Closed gshykhov closed 1 month ago

gshykhov commented 1 month ago

Version

4.3.1

Severity

Medium

Environment

msi

Steps to Reproduce

I use the New-UDDataGrid function to display a dataset with white spaces in the fields. The filter is not working when applied on these columns, it throws error. I suspect that the issue is with the Out-UDDataGridData function.

Here is an app to reproduce the issue.

New-UDApp -Title 'PowerShell Universal' -Content {
    New-UDDataGrid -LoadRows {
        $Data = @(
            @{ 'User Name' = 'Adam'; Number = Get-Random }
            @{ 'User Name' = 'Tom'; Number = Get-Random }
            @{ 'User Name' = 'Sarah'; Number = Get-Random }
        )
        $Data | Out-UDDataGridData -Context $EventData
    } -Columns @(
        New-UDDataGridColumn -Field 'User Name'
        New-UDDataGridColumn -Field 'Number'
    ) -Id 'dataGrid1'
} -HideUserName

Expected behavior

Columns with spaces are filtered correctly and without errors.

Actual behavior

Filtering columns with white spaces throws errors, and the filtering does not happen.
Please see the attached GIF.

Additional Environment data

No response

Screenshots/Animations

psu_data_grid_issue