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

c# - Reactive Extensions ControlScheduler -

ios - How to determine if NSLayoutConstraint is horizontal or vertical? -

javascript - Enable/Disable form elements and changing the values of button at a time? -