Textblock is overlapping with combobox items (WPF)

I am trying to make it so the combobox has some static text and will never show selected items. I thought I could have a TextBlock on top of it, but for some reason items from the combobox seem to randomly appear underneath it. I can't reproduce it every time. Here's the relevant xaml:
<Grid
Width="130"
VerticalAlignment="Center">
<Grid.Resources>
<CollectionViewSource x:Key="Columns" Source="{Binding MySource}" />
<DataTemplate DataType="{x:Type models:MyLabel}">
<CheckBox
Checked="CheckBox_CheckChanged"
Content="{Binding Label}"
IsChecked="{Binding IsSelected}"
Unchecked="CheckBox_CheckChanged" />
</DataTemplate>
</Grid.Resources>
<ComboBox
IsEditable="False"
IsReadOnly="True"
SelectedIndex="-1">
<ComboBox.ItemsSource>
<CompositeCollection>
<CheckBox
x:Name="SelectAllCb"
Checked="SelectAllCb_CheckedChanged"
Content="Select All"
Unchecked="SelectAllCb_CheckedChanged" />
<CollectionContainer Collection="{Binding Source={StaticResource Columns}}" />
</CompositeCollection>
</ComboBox.ItemsSource>
</ComboBox>
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
IsHitTestVisible="False"
Text="Show/Hide Columns" />
</Grid>
<Grid
Width="130"
VerticalAlignment="Center">
<Grid.Resources>
<CollectionViewSource x:Key="Columns" Source="{Binding MySource}" />
<DataTemplate DataType="{x:Type models:MyLabel}">
<CheckBox
Checked="CheckBox_CheckChanged"
Content="{Binding Label}"
IsChecked="{Binding IsSelected}"
Unchecked="CheckBox_CheckChanged" />
</DataTemplate>
</Grid.Resources>
<ComboBox
IsEditable="False"
IsReadOnly="True"
SelectedIndex="-1">
<ComboBox.ItemsSource>
<CompositeCollection>
<CheckBox
x:Name="SelectAllCb"
Checked="SelectAllCb_CheckedChanged"
Content="Select All"
Unchecked="SelectAllCb_CheckedChanged" />
<CollectionContainer Collection="{Binding Source={StaticResource Columns}}" />
</CompositeCollection>
</ComboBox.ItemsSource>
</ComboBox>
<TextBlock
Margin="5,0,0,0"
VerticalAlignment="Center"
IsHitTestVisible="False"
Text="Show/Hide Columns" />
</Grid>
Here's what it looks like sometimes:
No description
1 Reply
Nacho Man Randy Cabbage
The only thing I ever want visible on the non-pop up part of the combobox is "Show/Hide Columns". Update: It happens when clicking on the blankspace to the right of any checkbox's text. Figured it out. A combobox's items are not set to stretch horizontally by default. Setting the items' HorizontalContentAlignment to Stretch fixes it
Want results from more Discord servers?
Add your server