title: WPF - hiding listbox items
body: <p>I have a listbox where the itemtemplate is using a style. The styles specifies a border with a datatrigger setting the visibility of the border to collapsed depending on a property. This works fine except I can still see a very narrow line for each item, in the list, that is collapsed. I was hoping someone could help with how to set the visibility so that there are no visible traces as this is quite apparent when consecutive items have been collapsed.</p>
  
  <p>The datatemplate specifies an outer border with a dockpanel inside of this - there are then stackpanels docked to this.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Well this is a simplified template:</p>
  
  <pre><code>&lt;DataTemplate x:Key="myTemplate"&gt;
      &lt;Border BorderThickness="0"&gt;
          &lt;Border.Style&gt;
              &lt;Style&gt;
                  &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding Path=IsActive}" Value="False"&gt;
                          &lt;Setter Property="Border.Visibility" Value="Collapsed" /&gt;
                      &lt;/DataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/Border.Style&gt;
          &lt;DockPanel LastChildFill="True" HorizontalAlignment="Stretch"&gt;
              &lt;StackPanel DockPanel.Dock="Right" HorizontalAlignment="Right"  &gt;
                  &lt;TextBlock Text="{Binding Path=SeqNo, Converter={StaticResource SeqToTextConv}}"/&gt;
                  &lt;Label Content="..." /&gt;
              &lt;/StackPanel&gt;
          &lt;/DockPanel&gt;
      &lt;/Border&gt;
  &lt;/DataTemplate&gt;
  </code></pre>