I have gridview with information of the itemNumber and the price I also checked the box of enable selection in gridView task when the user click on select the item number should be added to the listbox without adding the same number again how can I do it.. I know how to get the selected item number from gridview and adding it to the listbox but I don't know how to avoid adding duplicate items

here is my code

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        GridViewRow row = GridView1.SelectedRow;
        string id = row.Cells[0].Text;         


Check if it's in the ListBox first

if (ListBox1.Items.Contains(id) == false) ListBox1.Items.Add(id);