Ayda Sayed
Ayda Sayed

Reputation: 509

DataGridTextColumn foreground color

I am trying to change the Foreground color of my grid header. I tried this but it changes only the elements in the column but not the header.

        <DataGrid Name="Datagrid"    RowBackground="Black" FontFamily="Trebuchet MS"   Grid.ColumnSpan="2"  Foreground="WhiteSmoke"
<DataGrid.Columns >
<DataGridTextColumn Header="ID" Binding="{Binding Id}" Width="*" Foreground="WhiteSmoke" >
                    <DataGridTextColumn.ElementStyle>
                        <Style TargetType="TextBlock">
                            <Setter Property="Foreground" Value="Black"></Setter>
                        </Style>
                    </DataGridTextColumn.ElementStyle>
                </DataGridTextColumn>
   </DataGrid>

Upvotes: 0

Views: 231

Answers (1)

Daniel
Daniel

Reputation: 9521

Modify the foreground of the DataGridColumnHeader

It should work

Upvotes: 1

Related Questions