title: Using LINQ to get DataGridView row index where first column has specific value
body: <p>I'd like to get the index of a DataGridViewRow, where the value of its first column matches.</p>
  
  <p>My code so far:</p>
  
  <pre><code>string SearchForThis = "test";
  
  int index = from r in dgv.Rows
              where r.Cells[0].Value == SearchForThis
              select r.Index;
  </code></pre>
  
  <p>The compiler error:</p>
  
  <p>Could not find an implementation of the query pattern for source type 'System.Windows.Forms.DataGridViewRowCollection'.  'Where' not found.  Consider explicitly specifying the type of the range variable 'r'.</p>