for (int nCounter = 0; nCounter <= dataGridView1.RowCount - 1; nCounter++) { if (txtrawmatno.Text == dataGridView1[2, nCounter].Value.ToString()) { MessageBox.Show("That product has been selected already.", "Repeat", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)