Hello,
I have the below code to change cell colour when the cell is selected:
<Style TargetType="{x:Type igDP:CellValuePresenter}"> <Setter Property="Background" Value="White" /> <Style.Triggers> <Trigger Property="IsSelected" Value="true"> <Setter Property="Background" Value="Red" /> </Trigger> </Style.Triggers></Style>
In the above example, I want the cell colour to be changed to red when the cell is selected. But the selected cell colour turned out to be gridient from light blue to red (Please see the attached screenshot). I have tried this style in a few xamDataGrids, but they all turned out to be the same.
Any idea why this might happen and how to fix?
Thanks.
It helped. Thank you.
The blue color is related to the active cell's default brush. You can try with one of the following styles:
<Style TargetType="{x:Type igDP:CellValuePresenter}">
<Setter Property="BackgroundActive" Value="Transparent" />
<Setter Property="BackgroundSelected" Value="Red" />
</Style>
<Setter Property="Background" Value="White" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" Value="Red" />
</Trigger>
</Style.Triggers>
Hope this helps.