title: C# Find duplicate Values in Datagridview
body: <p>doing some user interface restriction on my c sharp project.
  using visual studio 2008 and C#.net.</p>
  
  <p>So I have a little bit of code, its a nested for loop that should run through the columns rows and check if there's a duplicate.</p>
  
  <p>Thinking about it I should change the text to an array that I can print out since there can be more than 1 duplicate.</p>
  
  <p>Simply put, there is a league of parts, incrementing by one to be unique.  The user wish's to change the league parts, some go up some go down.</p>
  
  <p>here's what I have so far.</p>
  
  <pre><code> public void CheckForDuplicate()
      {
          DataGridViewRowCollection coll = ParetoGrid.Rows;
          DataGridViewRowCollection colls = ParetoGrid.Rows;
  
          foreach (DataGridViewRow item in coll)
          {
              foreach (DataGridViewRow items in colls)
              {
                  if (items.Cells[5].Value == item.Cells[5].Value)  
                  {   
                      if(items.Cells[2].Value != item.Cells[2].Value)
                      {
                          txtDupe.Text = items.Cells[2].Value.ToString();
                          this.Refresh();
                          dupi = false;
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>Nothing happens, nothing at all seems it's always false.  some odd reason debugging isn't catching anything.
  So I'm wandering if there's a silly one liner I've missed out, or if theres a much better way to do it?</p>
  
  <p>Many thanks!</p>