How to compare if combobox item is equal with listview item or listview already contains combobox item in c# -
How to compare or check whether the item in the combobox is already present in the list view or not? Please help ....
if (lvCart.Items.ContainsKey (cmbdummy.SelectedItem.ToString ())) {MessageBox.Show ("Duplicate Entry!"); }
You must check with the respective SelectedValue
.
Try it:
if (lvCart.Items.ContainsKey (cmbdummy.SelectedValue.ToString ()) {MessageBox.Show ("Duplicate Entry!"); }
Comments
Post a Comment