title: c# datagridview key handling
body: <p>I use DataGridView, and in some places I add control to it (e.g. textbox, combobox)</p>
  
  <pre><code> dataGridView1.Controls.Add(comboBox);
   comboBox.Focus();
  </code></pre>
  
  <p>The problem is that using this control, and than commiting choice by using ENTER cause the DataGridView to "handle" the key -> after clickng enter instead of choosing sth from combobox, the selection in datagridview changes( moves to next cell). </p>
  
  <p>I use sth like :</p>
  
  <pre><code>   public class MyDataGridView:DataGridView
  {
      protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
      {
          if(keyData == Keys.Enter)
          {
              return true;
          }
          return base.ProcessCmdKey(ref msg, keyData);
      }
  }
  </code></pre>
  
  <p>But it cause that datagridview and combobox doesn't answer to ENTER, and other keys... </p>
  
  <p>Additional infromation: I must use ComboBox class, instead of DataGridViewCombobox. Can anyone help me how to handle ENTER in my comobox?</p>