DataGridColumnHeader - Style does not work

Nov 1, 2008 at 12:40 PM
Hi devteam,

in the v2 of DataGrid, the DataGridColumnHeader seems to be ignored. I think, in v1, this worked correct :-(
Here the sample Code, what goes wrong?

<Window x:Class="Test_Style_DataGridColumnHeader.Window1"
    Title="Window1" Height="300" Width="300" xmlns:my="">
        <Style x:Key="defaultColumnHeaderStyle" TargetType="{x:Type my:DataGridColumnHeader}">
            <Setter Property="Background" Value="Red" />

        <my:DataGrid Margin="0,0,0,62" Name="dataGrid1">
                <my:DataGridTextColumn Header="Header" />

beste regards,
Nov 1, 2008 at 3:00 PM
You need to actually set the style resource on the DataGrid or remove the key so it can be an implicit style.
Nov 2, 2008 at 9:55 AM
Edited Nov 2, 2008 at 9:56 AM
remove the key
This is the solution, thank you!