Home > Net >  ListView ItemTemplate with seperator line
ListView ItemTemplate with seperator line

Time:03-19

This code from Items with Name, age and E-Mail of persons in a ListView without separator lines.

How can I achieve the same result but with a line separating the elements?

Items with Name, age and E-Mail of persons in a ListView with horizontal red lines in between them.

CodePudding user response:

You could use an item container style to draw a border at the bottom of each container.

<ListView.ItemContainerStyle>
   <Style TargetType="{x:Type ListViewItem}">
      <Setter Property="BorderThickness" Value="0,0,0,2"/>
      <Setter Property="BorderBrush" Value="Red"/>
   </Style>
</ListView.ItemContainerStyle>
  • Related