How to avoid Dupli Data Entry through Grid View To List box
How to avoid Duplicate data entry through DataGridView To ListBox when Button Click
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
ali tuncerRank #1,499 · 1.1K reputationPosted May 2, 2016, 8:28 PM EDT
Before you add item to listbox, you can check if item exists..
{
if (!listBox1.Items.Contains(row.Cells["col1"].Value))//check if it exist
{
listBox1.Items.Add(row.Cells["col1"].Value); //add item
}
}