大家都懂不多解释,直接上代码
<DataGrid.RowStyle >
<Style TargetType= " DataGridRow ">
<Style.Triggers>
<Trigger Property= " IsMouseOver " Value= " True ">
<Setter Property= " Background " Value= " #FFF1FAFF "/>
<Setter Property= " FontSize " Value= " 20 "/>
<Setter Property= " Height " Value= " 30 "/>
<Setter Property= " Foreground " Value= " Blue "/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle >
<Style TargetType= " DataGridCell ">
<Style.Triggers >
<Trigger Property= " IsSelected " Value= " True ">
<Setter Property= " Background " Value= " #FFF1FAFF "/>
<Setter Property= " FontSize " Value= " 20 "/>
<Setter Property= " Height " Value= " 30 "/>
<Setter Property= " Foreground " Value= " Blue "/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>
<Style TargetType= " DataGridRow ">
<Style.Triggers>
<Trigger Property= " IsMouseOver " Value= " True ">
<Setter Property= " Background " Value= " #FFF1FAFF "/>
<Setter Property= " FontSize " Value= " 20 "/>
<Setter Property= " Height " Value= " 30 "/>
<Setter Property= " Foreground " Value= " Blue "/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.RowStyle>
<DataGrid.CellStyle >
<Style TargetType= " DataGridCell ">
<Style.Triggers >
<Trigger Property= " IsSelected " Value= " True ">
<Setter Property= " Background " Value= " #FFF1FAFF "/>
<Setter Property= " FontSize " Value= " 20 "/>
<Setter Property= " Height " Value= " 30 "/>
<Setter Property= " Foreground " Value= " Blue "/>
</Trigger>
</Style.Triggers>
</Style>
</DataGrid.CellStyle>