title: comparing a datagridview cell with an integer value
body: <p>This coding was recently upgraded from C#.Net 2008 to C#.Net 2012. The value of this cell in this DataGridView = 4 but an exception is thrown every time my program arrives at this line. What am I missing here ?</p>
  
  <pre><code>if (((int)dgQueue.SelectedRows[0].Cells["StatusKey"].Value != 1 &amp;&amp; isRequestCheck))
  </code></pre>
  
  <p>I'm receiving an InvalidCastException with a detail explanation of Specified cast is not valid...</p>