title: Remove Border of WPF DataGrid Header column
body: <p>My requirement is that my WPF DataGrid rows should have border but the datagrid header column should not have any border.</p>
  
  <p>If I put DataGrid inside Border element, then entire grid, including header column, gets the border.</p>
  
  <p>I have set GridLinesVisibility="Horizontal".</p>
  
  <p>Is there any way to have border only for grid rows?</p>
  
  <p>Thanks!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is the xaml code I am using..</p>
  
  <pre><code>&lt;Style x:Key="DataGridColumnHeaderHiddenStyle" TargetType="{x:Type DataGridColumnHeader}"&gt;
              &lt;Setter Property="Height" Value="15" /&gt;            
              &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;            
          &lt;/Style&gt;
  
  &lt;StackPanel&gt;
              &lt;ScrollViewer MaxHeight="175" VerticalScrollBarVisibility="Auto"&gt;
                  &lt;DataGrid  ItemsSource="{Binding SelectedItemsCollectionView}" 
                        CellStyle="{StaticResource CellStyle}" GridLinesVisibility="Horizontal"  HorizontalGridLinesBrush="{StaticResource GridBorderBrush}" ClipToBounds="True" AllowDrop="True" 
                                ScrollViewer.CanContentScroll="True" 
                                ScrollViewer.VerticalScrollBarVisibility="Auto"
                                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  
                             x:Name="selectedItemsGrid"&gt;
  
  
                      &lt;DataGrid.ItemContainerStyle&gt;
                          &lt;Style TargetType="{x:Type DataGridRow}"&gt;
                              &lt;Setter Property="AllowDrop" Value="True" /&gt;
                          &lt;/Style&gt;
                      &lt;/DataGrid.ItemContainerStyle&gt;
                      &lt;DataGrid.Columns&gt;
                          &lt;DataGridTextColumn Binding="{Binding Path=Name}"&gt;
                              &lt;DataGridTextColumn.ElementStyle&gt;
                                  &lt;Style TargetType="TextBlock"&gt;
                                      &lt;Setter Property="TextAlignment" Value="Center" /&gt;
                                  &lt;/Style&gt;
                              &lt;/DataGridTextColumn.ElementStyle&gt;
                          &lt;/DataGridTextColumn&gt;
                      &lt;/DataGrid.Columns&gt;
                      &lt;DataGrid.Style&gt;
                          &lt;Style TargetType="DataGrid"&gt;
                              &lt;Setter Property="HeadersVisibility" Value="Column" /&gt;
                              &lt;Setter Property="ColumnHeaderStyle" Value="{StaticResource DataGridColumnHeaderHiddenStyle}" /&gt;
                          &lt;/Style&gt;
                      &lt;/DataGrid.Style&gt;
                  &lt;/DataGrid&gt;
              &lt;/ScrollViewer&gt;
          &lt;/StackPanel&gt;
  </code></pre>