<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock" >
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Yellow" />
</Style>
</DataGridTextColumn.ElementStyle>
<DataGridTextColumn.EditingElementStyle>
<Style TargetType="TextBox" >
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="Yellow" />
</Style>
</DataGridTextColumn.EditingElementStyle>
转载于:https://www.cnblogs.com/CoreXin/p/4385937.html