How to make WPF DataGrid Column Header transparent

Feb 2, 2010 at 4:20 PM


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 x:Key="DashboardGridStyle" TargetType="{x:Type tk:DataGrid}"> 
   <Setter Property="ColumnHeaderStyle" Value="{StaticResource DatagridColumnHeaderStyle}" /> 
   <Setter Property="Background" Value="Transparent" /> 
   <Setter Property="RowBackground" Value="Transparent" /> 
<tk:DataGrid Style="{StaticResource DashboardGridStyle}" > 

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

What am I missing?