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

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -