# Selection not Displayed Correctly when Special Slots are Used

## Environment

<table>
	<tr>
		<th scope="row">Product Version</th>
		<td>2020.2.617</td>
	</tr>
	<tr>
		<th scope="row">Product</th>
		<td>RadScheduleView for WPF</td>
	</tr>
</table>

## Description

The selection is not highlighted correctly when using special slots.

## Solution

The reason behind this behavior is that the **HighlightItem** controls that show the selection are drawn in the same panel as the HighlightItem controls that show the special slots. In some situations, the HighlightItems of the special slots are generated after those displaying the selection. In those cases the selection still works, but the special slot is drawn over the selection visual, so it seems like the selection is wrong.

To avoid this, you need to set the **Panel.ZIndex** attached property of the HighlightItems that show the special slots to a low value.

**Example 1: Set HighlightItem's ZIndex**

```XAML

  <local:SpecialSlotStyleSelector x:Key="SpecialSlotStyleSelector">
    <local:SpecialSlotStyleSelector.NonworkingHourStyle>
      <Style TargetType="telerik:HighlightItem">
        <Setter Property="Panel.ZIndex" Value="-100" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate>
              <Border Background="LightGray">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left">
                  <TextBlock Text="{Binding Slot.Description}" FontSize="10" FontStyle="Italic" Foreground="DarkSlateGray" />
                </StackPanel>
              </Border>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </local:SpecialSlotStyleSelector.NonworkingHourStyle>
  </local:SpecialSlotStyleSelector>
```

## See Also

* [Available Themes](https://www.telerik.com/products/wpf/documentation/styling-and-appearance/themes-suite/available-themes)
