Anyone know how to style the header hover color of a WPF ListView?
Thanks!
You have to create a style for the GridView.ColumnHeaderContainerStyle
property. Add the hover effect by setting some trigger to the Style.
For example:
<ListView VerticalAlignment="Bottom" Height="63" IsSynchronizedWithCurrentItem="True">
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle1}" >
<GridViewColumn/>
</GridView>
</ListView.View>
</ListView>
and the Style can be created like so:
<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With