I have a Windows Forms DataGridView that displays a list of students who are enrolled in a class. A combo box column in the DataGridView displays a list of alternative classes to which the student can be moved.
If a user selects a different class using the combo box, and then selects a different row in the DataGridView, the row that was just edited is removed from the DataGridView - correctly so, as it no longer meets the criteria.
My problem is that I need this to happen when the user selects the new value from the combo box, without waiting for the user to select another row. The reason is that if the row is not removed until the user selects another row, the rows move up to fill the gap left by the row that was removed, making the currently selected row the row below the one that the user selected, potentially confusing the user.
I've tried calling the Refresh method of the DataGridView, but the edited row still is not removed until the user selects another row.