I have a WinForms app, that displays a DataGridView. It is automatically populated from a BindingSource, and contains several rows of data. The columns include the standard things like strings. Some of these columns are CheckBoxes.
Name | User | Admin
---- ---- -----
John | X |
Fred | | X
I am writing some automated tests using TestStack.White. I can read the existing state of the CheckBoxes without issue.
How do I set or clear the checkboxes? I've tried:
Table.Rows[0].Cells[1].Value = true;
Fails because the underlying row/cell is deleted before White can read back the current value.
And also:
Table.Rows[0].Cells[1].SetValue(true);
Fails to set the new value.