I created my own datagridview control that includes the OnKeyDown event:
public partial class PMGrid : DataGridView { protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.SuppressKeyPress = true;
When I click on the datagridview and press Enter, it works fine because the row does not change and the KeyUp event is fired. But when I press Tab, the next cell is selected, and it changes to EditMode. And when I press Enter in this cell, the KeyUp event does not fire, nor does KeyPress either. I'm trying to make sure that the user can move from one cell to the next cell, and then the user can write something in this cell, and then when the user presses Enter, this value is stored in the database. But when the cell is in the EditMode, I cannot find that the user presses Enter.
thanks
source share