title: SELECT Unique rows from Datagridview using LINQ
body: <p>I am trying to SELECT ALL rows\columns from a datagridview where the first column is unique using LINQ. </p>
  
  <p>Datagridview:</p>
  
  <pre><code>1     Blue     1111
  1     Blue     1111
  2     Green    1234
  3     Orange   3211
  2     Green    1234
  4     Red      2222
  </code></pre>
  
  <p>Trying to get this Output:</p>
  
  <pre><code>1     Blue     1111
  2     Green    1234
  3     Orange   3211
  4     Red      2222
  </code></pre>
  
  <p>I was able to use the following code which pulls all unique records from the first column but I am not sure how to get the remaining columns:</p>
  
  <pre><code>        Dim unique() As String = (From row As DataGridViewRow In dgvMaestro.Rows.Cast(Of DataGridViewRow)() _
           Where Not row.IsNewRow _
           Select CStr(row.Cells(0).Value)).Distinct.ToArray
  
          For Each a As String In unique
              Debug.Print(a)
          Next
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>1
  2
  3
  4
  </code></pre>
  
  <p>Thanks</p>