If I set ComboBoxItem Visibilityto Collapsed, then I canโt see it when I open the drop-down menu ... but I can select it using the keys! Is this a mistake or am I missing something?
<Window x:Class="ComboTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<ComboBox>
<ComboBoxItem>Element 1</ComboBoxItem>
<ComboBoxItem>Element 2</ComboBoxItem>
<ComboBoxItem Visibility="Collapsed">Collapsed Element</ComboBoxItem>
</ComboBox>
</StackPanel>
</Window>
If I disable an item, I can still select it by pressing C. Is there a way to hide it without deleting it?
source
share