Change Selected DataGrid Row Style in WPF

Introduction
 
Below code describes how to change selected row background and foreground color using xmal in wpf.

<DataGrid.RowStyle>

<Style TargetType="{x:Type DataGridRow}">
    <
Style.Triggers>
      <
Trigger Property="IsSelected" Value="True">
        <
Setter Property="Foreground" Value="Red"/>
        <
Setter Property="Background" Value="Blue" />
      </
Trigger>
    </
Style.Triggers>
</
Style>
</
DataGrid.RowStyle>
Ebook Download
View all
Learn
View all