DataGridView, changing active cell within events
-
I have a DataGridView that triggers Parse, CellValidating and CellValueChanged events. I need to change the active cell in response of one of these events. For example, if the value of the cell is "1" I need to go to the third columns of the grid, and things like that. The problem is that apparently I can't change the active cell while I'm still in the event. If I do that, strange things happen, ranging from no effects to events calling themselves resulting in stack overflow. I managed to solve it with a dirty trick, but I am not satisfied yet. What is the correct way changing the active cell within an event?
-
I have a DataGridView that triggers Parse, CellValidating and CellValueChanged events. I need to change the active cell in response of one of these events. For example, if the value of the cell is "1" I need to go to the third columns of the grid, and things like that. The problem is that apparently I can't change the active cell while I'm still in the event. If I do that, strange things happen, ranging from no effects to events calling themselves resulting in stack overflow. I managed to solve it with a dirty trick, but I am not satisfied yet. What is the correct way changing the active cell within an event?
Have you tried to change the active cell from
CellValidated
event handler? Calin