我正在尝试更改网格标题的前景色。我试过了,但它只改变了列中的元素,而不是标题。
<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>