title: DataGridView - cell validation - prevent CurrentRow/Cell change
body: <p>I have WinForms <code>DataGridView</code> with source set to <code>SortableBindingList</code>. In this form, there's column <code>Comment</code> and I need to prevent user from inserting some characters, thus validation.</p>
  
  <p>What I want to do is, whenever user enters invalid value, system will notify him (<code>OnNotification( 'You entered wrong comment');</code>) and force him/her to stay in edit mode.</p>
  
  <p>So far I build solution like this:</p>
  
  <pre><code>void MyDataGridView_CellEndEdit( object sender, DataGridViewCellEventArgs e )
  {
      if (e.ColumnIndex == ColumnComment.Index) {
          object data = Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
          if( (data != null) &amp;&amp; (!CommentIsValid( data.ToString()))){
              CurrentCell = Rows[e.RowIndex].Cells[e.ColumnIndex];
              BeginEdit( true );
  
              // My notification method
              OnNotification( String.Format( "Comment `{0}` contains invalid characters) );
              return;
          }
      }
  }
  </code></pre>
  
  <p>I have following issues with this:</p>
  
  <ul>
  <li><code>OnCellValidating</code> is triggered only when whole form is closing or when current row is changed, not after I finish editing of <em>single cell</em>, so I've put check into <code>CellEndEdit</code>.</li>
  <li>When I used <code>Enter</code>/<code>Esc</code> to end editing, it works as expected and desired.</li>
  <li>When I use mouse and click to another row, cell stays in edit mode, but another row gets selected.</li>
  <li>When I try to use <code>Enter</code> (displays notification on invalid comment) and then <code>Esc</code> (to cancel edit) it uses value <em>pushed</em> by <code>Enter</code> (because edit mode has finished).</li>
  </ul>
  
  <p><strong>So my questions are</strong>:</p>
  
  <ul>
  <li>How can I fire <code>CellValidating</code> after each cell edit, not when form is closing</li>
  <li>How can I prevent <code>CurrentRow</code> and <code>CurrentCell</code> change even after mouse click?</li>
  <li>How can I force cell to <strong>stay</strong> in edit mode?</li>
  </ul>