Ron

Ron

  • NA
  • 44
  • 64.4k

Datagrid row style

Apr 25 2012 10:56 AM
I'm having difficulty getting a datagrid to behave properly.

This style does not have any effect on the grid rows:

<Style TargetType="{x:Type DataGridRow}">
    <Style.Triggers>
        <Trigger Property="IsSelected" Value="True">
            <Setter Property="Background" Value="Brown" />
            <Setter Property="Foreground" Value="White" />
        </Trigger>

        <Trigger Property="IsSelected" Value="False">
            <Setter Property="Background" Value="White" />
            <Setter Property="Foreground" Value="Black" />
        </Trigger>
    </Style.Triggers>
</Style>

What am I doing wrong?

Answers (2)