title: RadListBox selected border color WPF
body: <p>I'm working on a <code>WPF</code> application with <code>telerik</code> controls.</p>
  
  <p>I'm using <code>RadListBox</code> which is generated in run time according to number of records. So, if i have 10 records in my collection 10 RadListBox will be shown in the application. When i select each <code>RadListBox</code> a detailed view of the BindedItem will be shown in the nearby panel. Only one <code>RadListBox</code> can be selected at a time.</p>
  
  <p>When i select the RadListBox now its showing a gray background which is not visible and the users are not sure which is selected among the 10.</p>
  
  <p>Now i need to set a border for the selected <code>RadListBox</code>. So whenever the user selects a <code>RadListBox</code> the selected ListBox border should be red in color.</p>
  
  <p>Is there anyway that i can access the Selected <code>RadListBox</code> and its <code>Border</code> property?</p>
  
  <p>.XAML Code:</p>
  
  <pre><code> &lt;telerik:RadListBox Grid.Column="0" Grid.Row="0" Margin="0,25,0,0" BorderThickness="1" BorderBrush="#FFCBD8E8"  ItemsSource="{Binding MCollection, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True, ValidatesOnDataErrors=True}" ItemTemplate="{StaticResource ImageDataTemplate}" ItemContainerStyle="{StaticResource DraggableListBoxItem}" DragEnter="lseries_DragEnter" DragLeave="ls_DragLeave" Style="{StaticResource myListboxStyle}" SelectedItem="{Binding SSeries, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" telerik:StyleManager.Theme="Windows8" PreviewKeyDown="RadListBox_PreviewKeyDown" MouseDoubleClick="l_MouseDoubleClick" PreviewMouseDown="RadListBox_PreviewMouseLeftButtonDown" SelectionChanged="Mt_SelectionChanged"&gt;
  &lt;/telerik:RadListBox&gt;
  </code></pre>
  
  <p>Image Data Template:</p>
  
  <pre><code>&lt;DataTemplate  x:Key="ImageDataTemplate"&gt;
              &lt;Border BorderThickness="2" BorderBrush="#FF21A2DE" CornerRadius="2" VerticalAlignment="Top"&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="*" /&gt;
                          &lt;RowDefinition Height="20" /&gt;
                          &lt;RowDefinition Height="100" /&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;TextBlock x:Name="SeriesNo" Grid.Column="0"  Grid.Row="0" HorizontalAlignment="Center"&gt;
                          &lt;TextBlock.Style&gt;
                              &lt;Style TargetType="{x:Type TextBlock}"&gt;
                                  &lt;Style.Triggers&gt;
                                      &lt;DataTrigger Binding="{Binding Path=Istre, Mode=TwoWay, Source={StaticResource MViewModel}}" Value="False"&gt;
                                          &lt;Setter  Property="Text" Value="{Binding SNumber}"  /&gt;
                                      &lt;/DataTrigger&gt;
                                      &lt;DataTrigger Binding="{Binding Path=Istre, Mode=TwoWay, Source={StaticResource MViewModel}}" Value="True"&gt;
                                          &lt;Setter  Property="Visibility" Value="Collapsed" /&gt;
                                      &lt;/DataTrigger&gt;
                                  &lt;/Style.Triggers&gt;
                              &lt;/Style&gt;
                          &lt;/TextBlock.Style&gt;
                      &lt;/TextBlock&gt;
                      &lt;TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Center"&gt;
                          &lt;TextBlock.Style&gt;
                              &lt;Style TargetType="{x:Type TextBlock}"&gt;
                                  &lt;Style.Triggers&gt;
                                      &lt;DataTrigger Binding="{Binding Path=Istre, Mode=TwoWay, Source={StaticResource MViewModel}}" Value="False"&gt;
                                          &lt;Setter  Property="Text" Value="{Binding RDNumber}"  /&gt;
                                      &lt;/DataTrigger&gt;
                                      &lt;DataTrigger Binding="{Binding Path=Istre, Mode=TwoWay, Source={StaticResource MViewModel}}" Value="True"&gt;
                                          &lt;Setter  Property="Text" Value="{Binding SeriesNumber}" /&gt;
                                      &lt;/DataTrigger&gt;
                                  &lt;/Style.Triggers&gt;
                              &lt;/Style&gt;
                          &lt;/TextBlock.Style&gt;
                      &lt;/TextBlock&gt;
                      &lt;Image x:Name="viewImage" Grid.Row="2" Stretch="Uniform"  Height="100" Width="135" Source="{Binding DisplayImage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, NotifyOnSourceUpdated=True, ValidatesOnDataErrors=True}" Visibility="Visible" /&gt;
                      &lt;TextBlock x:Name="viewText" Grid.Row="2" VerticalAlignment="Center" Height="100" HorizontalAlignment="Center" /&gt;
                  &lt;/Grid&gt;
              &lt;/Border&gt;
          &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>Image of the list of RadListBox:</p>
  
  <p><a href="https://i.stack.imgur.com/aUhbT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aUhbT.png" alt="List Of RadListBox"></a></p>