Created
April 18, 2014 08:02
-
-
Save dkalamari/11030646 to your computer and use it in GitHub Desktop.
WPF datagrid row alternate color
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Style TargetType="{x:Type DataGrid}"> | |
<Setter Property="Background" Value="#FFF" /> | |
<Setter Property="AlternationCount" Value="2" /> | |
</Style> | |
<Style TargetType="{x:Type DataGridRow}"> | |
<Style.Triggers> | |
<Trigger Property="ItemsControl.AlternationIndex" Value="0"> | |
<Setter Property="Background" Value="#EFEFEF"></Setter> | |
</Trigger> | |
<Trigger Property="ItemsControl.AlternationIndex" Value="1"> | |
<Setter Property="Background" Value="#FFF"></Setter> | |
</Trigger> | |
<Trigger Property="IsMouseOver" Value="True"> | |
<Setter Property="Background" Value="LightBlue" /> | |
</Trigger> | |
</Style.Triggers> | |
</Style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment