title: C# - Removing right edge row border in WPF DataGrid
body: <p>I am trying to remove the far right GridLine in a WPF GridView.
  Here is an example .xaml</p>
  
  <pre><code>&lt;Window x:Class="Pack.ExampleForm"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:Pack"
      Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
      Width="400" Height="300"&gt;
  
      &lt;DataGrid Margin="5" AutoGenerateColumns="False" 
          CanUserReorderColumns="False" HeadersVisibility="Column"&gt;
  
          &lt;DataGrid.Columns&gt;
              &lt;DataGridTextColumn Binding="{x:Null}" CanUserResize="False"/&gt;
              &lt;DataGridTextColumn Binding="{Binding Path=Key}" Header="Request Header" Width="*"/&gt;
              &lt;DataGridTextColumn Binding="{Binding Path=Value}" Header="Value" Width="*"/&gt;
          &lt;/DataGrid.Columns&gt;
  
          &lt;local:RequestHeader Key="Subject 1" Value="Body 1" /&gt;
          &lt;local:RequestHeader Key="Subject 1" Value="Body 1" /&gt;
      &lt;/DataGrid&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>However this has the far right gridline, as show in the designer, circled in yellow.</p>
  
  <p><img src="https://i.stack.imgur.com/WaPBv.png" alt="Example"></p>
  
  <p>Is there any way to remove this and have no border, as it is on the left side. Would prefer to do this in the .xaml if possible.</p>