I need some help. I am doing an insertion of items into a request, using a DataGridView, in that DataGridView I have the code column, , batch , and qtda . I need to validate the code column, so if I have already entered code 1, it does not re-enter code 1, ie I can not have repeated items in grid .
Follow the insert command,
Button method Inseri_Itens
private void btn_inserir_Click(object sender, EventArgs e)
{
if (txt_qtda.Text != "")
{
DGW_itens.Rows.Add(txt_codigo.Text, txt_produto.Text, cb_lote.Text, txt_fabric.Text, txt_qtda.Text, txt_numero.Text);
txt_codigo.Text = "";
txt_produto.Text = "";
cb_lote.Items.Clear();
cb_lote.Text = "";
txt_fabric.Text = "";
txt_qtda.Text = "0.00";
txt_idsolicitacao.Text = "";
btn_gravar.Enabled = true;
}
else
{
MessageBox.Show("Não existem itens a serem incuidos, por favor verifique se o campo Qtda. esta preenchido!!!");
return;
}
}
Thank you in advance.