Dyda
✅ Change dataGridRow:selected row
Hi, I’m encountering an issue with changing the selected row color in a DataGrid. I’m using something like this:
<Application.Styles>
<FluentTheme>
<FluentTheme.Palettes>
<ColorPaletteResources x:Key="Light" Accent="Green" RegionColor="White" ErrorText="Red" />
<ColorPaletteResources x:Key="Dark" Accent="Yellow" RegionColor="#2D2D2D" ErrorText="Red" />
</FluentTheme.Palettes>
</FluentTheme>
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
<Style Selector="DataGridRow:selected">
<Setter Property="Foreground" Value="Black" />
<Setter Property="Background" Value="LightBlue" />
</Style>
</Application.Styles>
After selection, the foreground color updates, but the background color remains yellow (inherited from FluentTheme) and no error are shown.
8 replies