I am trying to support editing multiple cells on a datagridview. I am nearly complete, as it correctly copies the contents to other cells when the editing is done. What I am working on now is capturing the first key pressed.
When I am editing just one cell, using EditOnKeystrokeOrF2 works fine. However, when multiple cells are selected, I am capturing the Keydown event and manually calling BeginEdit. When I do that, however, the pressed key isn’t included in the edit.
How can I get that first key pressed into my cell?
I did some additional experimenting and found a way to make this happen. It is a bit sloppy, but it works.
By registering for the CellBeginEdit event, I can plop the value in there. I do some other processing of the _keyValue to make it a number, but that isn’t relevant to the rest of this.