Change Row Style of Data Grid in WPF

Introduction

This blog describes the procedure of changing the Row Style such as the Background, Foreground color, font family, etc., using Setter and Trigger, using XAML in WPF.

<DataGrid.RowStyle>

  <Style TargetType="{x:Type DataGridRow}">
    <
Setter Property="FontSize" Value="14"/>
    <
Setter Property="FontFamily" Value="Arial"/>
    <
Setter Property="FontWeight" Value="Bold"/>
    <
Setter Property="Foreground" Value="White"/>
    <
Setter Property="Background" Value="Black"/>
  </
Style>
</
DataGrid.RowStyle>
</
DataGrid>