How to make WPF DataGrid Column Header transparent
        Posted  
        
            by joerage
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by joerage
        
        
        
        Published on 2010-02-01T20:51:02Z
        Indexed on 
            2010/04/08
            14:23 UTC
        
        
        Read the original article
        Hit count: 1403
        
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?
© Stack Overflow or respective owner