title: Preventing duplicates before insert in datagridview
body: <p>i want to add(or insert) row after selecting one, but first i need to check if what i am adding isn't duplicate, every time i enter two values that are the same i achieving strange results, i was using <code>foreach</code> and now <code>for</code> statement but none of these helped me:</p>
  
  <pre><code>        private void plus()
      {
          for (int i = 0; i &lt; dataGridView2.Rows.Count; i++)
          {
              if (textBox1.Text == dataGridView2.Rows[i].Cells[0].Value.ToString())
              {
                  MessageBox.Show("duple");
                  break;
              }
              else
              {
                  dataGridView2.Rows.Add(textBox1.Text.Trim(), pictureBox3.Image, pictureBox6.Image);
                  break;
              }
          }
          textBox1.SelectAll();
          textBox1.Focus();
      }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/jakqU.png" alt="enter image description here"></p>