I am working on a Powershell script which has a tab control containing a datagridview that is not bound to anything (i.e. database). The user checks some checkbox columns in the datagridview, selects an Apply button, then I compute some data and update the checked rows in the table programmatically. The datagridview consists of 3 columns and n rows. Colum 0 is checkbox, column 1 is a name and column 2 is a state.
I can update the appropriate cell with the command:
$dgvList.Rows[$row].Cells[$STATE_INDEX].value = $newState
However, the screen does not update with the new state. I have tried several variations the following:
$dgvList.RefreshEdit
$dgvList.Invalidate
$dgvList.InvalidateCell
$dgvList.Update
Nothing, seems to work. I have no bound datasource, so I don't need to tweak that. Clearing all the rows in the table and adding them back in does work to a lesser degree, but feels very inefficient and I lose any selected rows the user may have checked. As it stands, I am still losing any rows that have been checked.
Appreciate, any insight