I'm trying to add some rows to a DataGridView.
After I get past the 12th row it stops displaying.
When I break in via the debugger, I can see that my DGV has all the rows. They just don't get displayed.
I've tried doing the equivalent of giving it a swift kick (moving focus around, moving the selection to the last item, Application.DoEvents() and so on, but to no avail).
OtherButton.Focus();
MoveFocusToNext();
_policyDataGrid.Focus();
_policyDataGrid.Rows[_policyDataGrid.Rows.Count - 1].Cells[0].Selected = true;
Application.DoEvents();
_policyDataGrid.Rows[0].Cells[0].Selected = true;
Application.DoEvents();
Does anyone know a workaround?
NB: I've seen a lot of posts where the DataGridView has a binding source, but this one doesn't. It's got a lot of manual Rows.Add().