title: WPF How to change header color of gridview
body: <p>I've been trying to learn how to customize a ListView which contains a GridView.</p>
  
  <p>I've been able to figure out and learn each part that I require... except for one.</p>
  
  <p><a href="https://i.stack.imgur.com/PoEsS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PoEsS.png" alt="enter image description here"></a></p>
  
  <p>How do I change the color of those white lines between each header column name?</p>
  
  <p>XAML:</p>
  
  <pre><code>&lt;Window x:Class="UITest.MainWindow"
          xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
          xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
          xmlns:local="clr-namespace:UITest"
          mc:Ignorable="d"
          Title="MainWindow" Height="200" Width="400"&gt;
      &lt;StackPanel&gt;
          &lt;ListView Margin="0 50 0 0" Name="lvUsers" BorderBrush="{x:Null}" BorderThickness="0" Background="Red" Padding="0"&gt;
              &lt;ListView.View&gt;
                  &lt;GridView&gt;
                      &lt;GridView.ColumnHeaderContainerStyle&gt;
                          &lt;Style TargetType="{x:Type GridViewColumnHeader}"&gt;
                              &lt;Setter Property="Background" Value="DarkBlue"&gt;&lt;/Setter&gt;
                              &lt;Setter Property="Foreground" Value="White"&gt;&lt;/Setter&gt;
                              &lt;Setter Property="BorderBrush" Value="{x:Null}"&gt;&lt;/Setter&gt;
                              &lt;Setter Property="BorderThickness" Value="0"&gt;&lt;/Setter&gt;
                              &lt;Setter Property="Margin" Value="0"&gt;&lt;/Setter&gt;
                              &lt;Setter Property="Padding" Value="0"&gt;&lt;/Setter&gt;
                          &lt;/Style&gt;
                      &lt;/GridView.ColumnHeaderContainerStyle&gt;
                      &lt;GridViewColumn Header="Name" Width="120" DisplayMemberBinding="{Binding Name}" /&gt;
                      &lt;GridViewColumn Header="Age" Width="50" DisplayMemberBinding="{Binding Age}" /&gt;
                      &lt;GridViewColumn Header="Mail" Width="150" DisplayMemberBinding="{Binding Mail}" /&gt;
                  &lt;/GridView&gt;
              &lt;/ListView.View&gt;
              &lt;ListView.ItemContainerStyle&gt;
                  &lt;Style TargetType="ListViewItem"&gt;
                      &lt;Setter Property="Background" Value="Blue"&gt;&lt;/Setter&gt;
                      &lt;Setter Property="Foreground" Value="White"&gt;&lt;/Setter&gt;
                  &lt;/Style&gt;
              &lt;/ListView.ItemContainerStyle&gt;
          &lt;/ListView&gt;
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>And here is the .CS code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Data;
  using System.Windows.Documents;
  using System.Windows.Input;
  using System.Windows.Media;
  using System.Windows.Media.Imaging;
  using System.Windows.Navigation;
  using System.Windows.Shapes;
  
  namespace UITest
  {
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
              List&lt;User&gt; items = new List&lt;User&gt;();
              items.Add(new User() { Name = "John Doe", Age = 42, Mail = "john@doe-family.com" });
              items.Add(new User() { Name = "Jane Doe", Age = 39, Mail = "jane@doe-family.com" });
              items.Add(new User() { Name = "Sammy Doe", Age = 7, Mail = "sammy.doe@gmail.com" });
              lvUsers.ItemsSource = items;
          }
  
          public class User
          {
              public string Name { get; set; }
  
              public int Age { get; set; }
  
              public string Mail { get; set; }
  
          }
      }
  }
  </code></pre>