title: So DataGridView.Rows and DataGridView.SelectedRows return different 'row' types?
body: <p>I had two <code>foreach</code> loops in my code. One for all rows in a DataGridView and one for selected rows only. Something like this:</p>
  <pre><code>foreach (DataGridViewRow row in dataGridView1.Rows)
  {
      //do some stuff here
  }
   
  foreach (DataGridViewRow row in dataGridView1.SelectedRows)
  {
      //do very similar stuff here
  }
  </code></pre>
  <p>As both loops did very similar things, I tried to combine them using a ternary condition inside one <code>foreach</code>. Both of them have <code>DataGridViewRow</code> as their type in their respective <code>foreach</code>, it should be pretty simple. I wrote the code as follows:</p>
  <pre><code>foreach (DataGridViewRow row in allrows ? dataGridView1.Rows : dataGridView2.SelectedRows)
  {
      //do stuff here
  }
  </code></pre>
  <p>To my surprise, I got a compiling error saying that there is no implicit conversion between <code>DataGridView.Rows</code> and <code>DataGridView.SelectedRows</code>, even though we can use <code>DatGridViewRow</code> on them separately.
  Reading through both properties' documentation on Microsoft's site, they define them both as a collection of rows, so why can't we use them in the same ternary condition?</p>