DataGrid 中选定行的默认背景颜色太暗,我无法读取它。有没有办法覆盖它?
试过这个
<dg:DataGrid.RowStyle>
<Style TargetType="{x:Type dg:DataGridRow}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True" >
<Setter Property="Background" Value="Gainsboro" />
</Trigger>
</Style.Triggers>
</Style>
</dg:DataGrid.RowStyle>
但还是什么都没有...
在我的例子中,上述解决方案在每个单元格周围留下了蓝色边框。
这是对我有用的解决方案。非常简单,只需将其添加到您的DataGrid
。您可以将其更改为SolidColorBrush
任何其他画笔,例如线性渐变。
<DataGrid.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
Color="#FF0000"/>
</DataGrid.Resources>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)