title: Unexpected Null Reference Exception on a DataGridView.CurrentCell.RowIndex property
body: <p>Is it possible for a <code>DataGridView.CurrentCell</code> property to be not <code>null</code> and yet have a <code>null</code> value on its <code>RowIndex</code> property?
  If so, how could I go about preventing this?</p>
  
  <p>Extra info:
  This value is beign checked on a <code>SelectionChanged</code> event for the <code>DataGridView</code> to keep the currently selected row's index stored in a class field.</p>
  
  <p>Code is as follows:</p>
  
  <pre><code>private void dgTraffic_SelectionChanged(object sender, EventArgs e)
  {
      try
      {
          if (dgReport.CurrentCell != null)
              actualRow = dgReport.CurrentCell.RowIndex;
      }
      catch (NullReferenceException ex)
      {
      #if DEBUG
          MessageBox.Show("Error on dgTraffic_SelectionChanged:\n" + ex.Message);
      #endif
      }
  }
  </code></pre>
  
  <p>Somehow I got an unhandled NullReferenceException at the line that references the RowIndex property, so I added the try-catch but I can't figure out how could that happen.
  By the way, I realize the method name says "dgTraffic" and the object used in the method's body reads dgReport. It is in fact set like that, this is the method being used for dgReport's SelectionChanged event.</p>