c# - Prevent windows forms datagridview to change row after cell edit -
this question has answer here:
i have datagridview in windows forms, default behavior when editing values after edition of cell, when press enter, selected row changes next.
i don't want that, want exit edit mode staying in same cell.
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
Post a Comment