c# - Prevent windows forms datagridview to change row after cell edit -


i have datagridview in windows forms, default behavior when editing values after edition of cell, when press enter, selected row changes next.

enter image description here

i don't want that, want exit edit mode staying in same cell.

enter image description here

is possible?

you can customize datagridview override processdialogkey method:

public class customgrid : datagridview {                     protected override bool processdialogkey(keys keydata) {             if (keydata == keys.enter) {                     endedit();                 return true;             }             return base.processdialogkey(keydata);         } } 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -