Anyone know how to style the header hover color of a WPF ListView?
Thanks!
Anyone know how to style the header hover color of a WPF ListView?
Thanks!
You have to create style for GridView.ColumnHeaderContainerStyle property. Add the hover effect by setting some trigger to the Style. sample XAML bellow
<ListView VerticalAlignment="Bottom" Height="63" IsSynchronizedWithCurrentItem="True">
<ListView.View>
<GridView ColumnHeaderContainerStyle="{StaticResource GridViewColumnHeaderStyle1}" >
<GridViewColumn/>
</GridView>
</ListView.View>
</ListView>
And the Style can be created as bellow, the bellow code will create Green color on hover over
<Style x:Key="GridViewColumnHeaderStyle1" TargetType="{x:Type GridViewColumnHeader}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="Green"/>
</Trigger>
</Style.Triggers>
</Style>
This doesn't work for me on Vista. Default colors are applied.
Any workarounds?