tags:

views:

878

answers:

3

I want to hide the selected item from the opened WPF combo box, basically to show instead of this:

item2
 item1
 item2
 item3

this:

item2
 item1
 item3

How can this be done?

A: 
csuporj
+1  A: 

Why don't you change the selected item's visibility instead?

Martinho Fernandes
I've seen that comboboxItem1.SelectedItem's type is object, so I thought that it is just the string I've put in there, and not a ComboBoxItem. Your approach works well if there is at least one visible item in the combo box (the selected item's visibility must be set to Collapsed).
csuporj
+1  A: 
Danny Varod