c# - Detecting if an item is selected or not in a listbox (WPF) -


I want to know how you can know whether an item list is selected in item items of list or not. , So I need to iterate them all and see which ones are selected and who are not.

Many thanks (I know - short and sweet)

selected items Look at the property, and again to see what item has been selected.

If you want to go through all the items, you can compare two collections (items selected from maliciousbox items and mylistbox) and see which matches

Something like this:

  foreach (item item in MyListBox.Items) if (MyListBox.SelectedItems.Contains (item) MyObject.Value = true; else MyObject.Value = false;  

Really overwhelmed! I believe that if you want to do all the things which no have been chosen, then that's why you What is the need to do this?

There are better ways to do this - Randolph is correct, the database will be a better way to go about how your data is organized / input and how much Big list is hidden.


Comments