How to change enter key behavior in data grid view?

  • Thread starter Thread starter IvicaNesic
  • Start date Start date
I

IvicaNesic

Guest
Greetings community

I have a simple problem. I have a table of several columns, and I want it to be editable without using a mouse. I want user to enter value in the first column, press enter key on keyboard, enter value in second column, press enter key, and so on. I want data grid view to open another row only when all columns in the working row are populated. However, pressing the enter key causes opening new row whenever user presses the enter key.

I tried to set current cell of data grid view in CellValueChanged event , but it didn’t work. Actually, it really moves current cell where I want, but after that it moves it one row down. I traced the execution of code, and counted CurrentCellChanged events to see what happens.

Does anyone know if there’s any way to suppress this behavior?

Thanks in advance

Continue reading...
 


Write your reply...
Back
Top