Hello,
I have a simple'Windows Forms' application,
which displays computer objects in a'Datagridview' ('Datatable').
This works very well.
To sort the view by active and inactive computers, I have two checkboxes .
But when I update the Datagridview again, I suddenly have columns I haven't seen before.
e.g. "DataView" "RowVersion" "IsNew" etc.
Since I export the view of the Datagrid later as CSV, I don't want to have these columns with me.
How can I prevent them from being displayed?
Maybe I don't read the view of the datagrid correctly either?
Enclosed the code, an image of the GUI and the exported Excel csv, then it will surely be clearer.
The code of the checkbox is:
- if ($checkboxDisabled.CheckState -eq 'Checked')
- {$DT = ConvertTo-DataTable -InputObject ($datagridview.Rows | Select-Object -ExpandProperty DataBoundItem)
- $DT.DefaultView.RowFilter = "Active like '%no%'"
- Update-DataGridView -DataGridView $datagridview -Item $DT #-AutoSizeColumns AllCells
- $datagridview.Refresh()
- $countFiltered.Invoke()
- }