title: How to process Key.Enter and prevent row change on WinForms CustomDataGridView
body: <p>I am trying to stop the enter key on winforms <code>dataGridView</code> of changing the row when <code>DataGridViewTextBoxColumn</code> cell is in <code>edit-mode</code> and enter is pressed. Otherwise the functionality should stay normal.</p>
  
  <p>My preferred approach is to create <code>CustomDataGridView</code> and override the necessary methods. My approach seem to end <code>edit-mode</code> but without firing <code>CellValidating</code> event.</p>
  
  <p>Currently this event is used to validate the user input.</p>
  
  <pre><code>  public class CustomDataGridView : DataGridView
    {
      protected override bool ProcessDialogKey(Keys keyData)
      {
        if (keyData == Keys.Enter)
        {
          if (MyProcessDialogKey(keyData)) return true;
        }
  
        return base.ProcessDialogKey(keyData);
      }
  
      protected bool MyProcessDialogKey(Keys keyData)
      {
  
        EndEdit();
        return true;
      }
    }
  </code></pre>
  
  <p>How can I raise the <code>CellValidating</code> event? Or should I consider different approach?</p>