Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF DataGridRow IsMouseOver Foreground is not working while it's IsSelected?

$
0
0

Hi,

I found that DataGridRow Foreground IsSelected and IsMouseOver is not working well. I'm looking a solution to set Foreground IsMouseOver overriding Foreground IsSelected when it's IsSelected for DataGridRow. However, i found out it's only working for DataGridCell by using Trigger.

I'm curious why it's working for Background when it's set to Transparent, but it's seems doesn't work for Foreground? Please advise.

Below is my code:-

<DataGrid.Resources><SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" /><SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Transparent" /></DataGrid.Resources><DataGrid.RowStyle><Style TargetType="DataGridRow"><Style.Triggers><Trigger Property="IsSelected" Value="True"><Setter Property="Background" Value="Orange" /><Setter Property="Foreground" Value="Green" /></Trigger><Trigger Property="IsMouseOver" Value="True"><Setter Property="Background" Value="Pink"/><Setter Property="Foreground" Value="Red" /></Trigger></Style.Triggers></Style></DataGrid.RowStyle>


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>