title: DataGridView, how to capture a cell's KeyPress event C#
body: <p>i want to do treatement for a cell in datagridview c#, this traitement is open a form when i press a cell.</p>
  
  <p>in C# there isn't an event (keypress) which allows me to add my treatment directly</p>
  
  <p>After search on internet, I found the following solution</p>
  
  <pre><code> private void dGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
      {
          e.Control.KeyPress +=
          new KeyPressEventHandler(Control_KeyPress);
      }
  
  
             private void Control_KeyPress(object sender, KeyPressEventArgs e)
          {
              if ((Strings.Asc(e.KeyChar) &gt;= Strings.Asc(Keys.A.ToString()) &amp;&amp; Strings.Asc(e.KeyChar) &gt;= Strings.Asc(Keys.Z.ToString())) || (Strings.Asc(e.KeyChar) &gt;= Strings.Asc(Keys.D0.ToString()) &amp;&amp; Strings.Asc(e.KeyChar) &gt;= Strings.Asc(Keys.D9.ToString()) || (Strings.Asc(e.KeyChar) &gt;= 97 &amp;&amp; Strings.Asc(e.KeyChar) &gt; 122)))
              {
                  ------
              }
        }
  </code></pre>
  
  <p>but it doesn't work.
  in debug  the code of the event dGridView_EditingControlShowing was executed but the code of Control_KeyPress function does not run </p>
  
  <p>any ideas please</p>