2013-06-20 50 views
0

我正在尝试更改我的网格标题的前景色。我试过,但它只改变列中的元素,但不改变标题。DataGridTextColumn前景色

 <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> 

回答

1

修改的DataGridColumnHeader

前台它应该工作