How to make WPF DataGrid Column Header transparent

Feb 2, 2010 at 3:20 PM

Hi,

I am trying to make the column header of my WPF Datagrid to be transparent.

I am able to set it to a color without problem, but I can't have it transparent. Here is what I tried:

<Style x:Key="DatagridColumnHeaderStyle" TargetType="{x:Type tk:DataGridColumnHeader}"> 
   <Setter Property="Background" Value="Transparent" /> 
   <Setter Property="Foreground" Value="#C2C4C6" /> 
</Style> 
 
<Style x:Key="DashboardGridStyle" TargetType="{x:Type tk:DataGrid}"> 
   <Setter Property="ColumnHeaderStyle" Value="{StaticResource DatagridColumnHeaderStyle}" /> 
   <Setter Property="Background" Value="Transparent" /> 
   <Setter Property="RowBackground" Value="Transparent" /> 
</Style> 
 
<tk:DataGrid Style="{StaticResource DashboardGridStyle}" > 
... 
</tk:DataGrid> 

With this code, it seems to take the default brush.

What am I missing?