title: Style Nth item in ItemsControl
body: <p>I have an <code>ItemsControl</code> with an associated <code>DataTemplate</code> as below.  My question is how can I style the Nth item in the <code>ItemsControl</code> differently? I am trying to place borders on certain items only.</p>
  
  <pre><code>    &lt;DataTemplate x:Key="CTemplate"&gt;
          &lt;Grid HorizontalAlignment="Left" Width="200" Height="Auto" Margin="0,0,30,30"&gt;
              &lt;Grid.ColumnDefinitions&gt;
                  &lt;ColumnDefinition Width="Auto"/&gt;
                  &lt;ColumnDefinition Width="10"/&gt;
                  &lt;ColumnDefinition Width="*"/&gt;
              &lt;/Grid.ColumnDefinitions&gt;
              &lt;StackPanel Orientation="Vertical" Grid.Column="0"&gt;
                  &lt;TextBlock Text="Device Name:" Style="{StaticResource i2_TB}"/&gt;
                  &lt;TextBlock Text="Device ID:" Style="{StaticResource i2_TB}" /&gt;
              &lt;/StackPanel&gt;
              &lt;StackPanel Orientation="Vertical" Grid.Column="2"&gt;
                  &lt;TextBlock Text="{Binding DeviceName}" Style="{StaticResource i2_TB}" TextTrimming="CharacterEllipsis" /&gt;
                  &lt;TextBlock Text="{Binding DeviceID}" Style="{StaticResource i2_TB}" TextTrimming="CharacterEllipsis" /&gt;
              &lt;/StackPanel&gt;
          &lt;/Grid&gt;
      &lt;/DataTemplate&gt;
  </code></pre>