DataGridColumnHeader - Style does not work

Nov 1, 2008 at 11:40 AM
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 2: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 8:55 AM
Edited Nov 2, 2008 at 8:56 AM
remove the key
This is the solution, thank you!