I would like to change the style of the first row (only) in WPF Datagrid, but did not find how to do it. I wondered about creating a trigger, something like this:
<Style TargetType="{x:Type dg:DataGridRow}">
<Style.Triggers>
<Trigger Property="SelectedIndex" Value="0">
<Setter Property="Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
But of course, this will not work, because the DataGridRow does not have the SelectedIndex property. I also had some attempts to do this in my code, but I could not get it to work.
It seems that something that was pretty simple, but I could not handle it, so any advice would be most appreciated.
Thanks, Will
Willh source
share