-
|
I have test app where I have defined DataGrid background colors for selected and hover rows in This work like expected, hovering background color changes when mouse is over: Screen.Recording.2025-11-03.080150.mp4But when I enable alternating background color for the DataGrid hover color is not changing for those alternating rows: Screen.Recording.2025-11-03.080458.mp4When mouse is over alternating background color is shown instead defined hover color. Is there some way to make background color to change when mouse is over if alternating coloring is in use? This is the xaml-file used: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
@juusimaa just to grasp your problem: Minimal repro (to my understanding): <DataGrid AlternatingRowBackground="Green"
CanUserAddRows="False"
CanUserDeleteRows="False"
IsReadOnly="True"
ItemsSource="{Binding Numbers}">
<DataGrid.Resources>
<SolidColorBrush x:Key="MaterialDesign.Brush.DataGrid.RowHoverBackground" Color="Red" />
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding .}" Header="Number" />
</DataGrid.Columns>
</DataGrid>public partial class MainWindow
{
public List<int> Numbers { get; }
public MainWindow()
{
Numbers = Enumerable.Range(0, 100).ToList();
DataContext = this;
InitializeComponent();
}
} |
Beta Was this translation helpful? Give feedback.
@juusimaa just to grasp your problem:
the bug you are reporting is that the
MaterialDesign.Brush.DataGrid.RowHoverBackgrounddoes not take precedence over theAlternatingRowBackground?If so, can you please open an issue so this bug can be tracked a little easier?
Minimal repro (to my understanding):