Posted 14 years ago
by Niclas Lindblom
![Avatar](https://secure.gravatar.com/avatar/98da1211d8cc9d949f177e0f4d6f18c8.jpg?s=64&d=identicon&r=g)
A follow on to my previous thread, but thought it would be better to start a new one.
I have managed to center the content in the Grid based on answers here. I now want to change the colour of the selected row. I have the following XAMLHowever, the Background change does not take effect this this. If I remove the BasedOn statement in the Style declaration, the Background change works but I then loose the Centering of the content.
Any ideas on what the solution to this is ?
Thanks
Niclas
I have managed to center the content in the Grid based on answers here. I now want to change the colour of the selected row. I have the following XAML
<Style x:Key="CenterCellStyle" TargetType="{x:Type toolkit:DataGridCell}" BasedOn="{StaticResource {x:Static themes:DataGridCommonDictionary.DataGridCellStyleKey}}" >
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Style.Triggers>
<Trigger Property="toolkit:DataGridCell.IsSelected" Value="True">
<Setter Property="Background" Value="Gray" />
</Trigger>
</Style.Triggers>
</Style>
Any ideas on what the solution to this is ?
Thanks
Niclas