Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 330883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:43:22+00:00 2026-05-12T09:43:22+00:00

I have WPF ListView with GridView view and I want to remove any trace

  • 0

I have WPF ListView with GridView view and I want to remove any trace of row highlight.

This useful piece of code can be found in one answer on this site:

     <ListView.ItemContainerStyle>
        <Style TargetType="{x:Type ListViewItem}">
           <Setter Property="Control.Focusable" Value="False"/>
           <Style.Triggers>
              <Trigger Property="IsMouseOver" Value="True">
                 <Setter Property="Background" Value="{x:Null}" />
                 <Setter Property="BorderBrush" Value="{x:Null}" />
              </Trigger>
           </Style.Triggers>
        </Style>
     </ListView.ItemContainerStyle>

However, while this change helps to remove most of the highlight, it does not remove the horizontal bar that still appears when mouse moves over the ListView row. How do I remove it?

I have dealt with the similar problem involving Button and found a solution that changes Button template by removing its chrome.

In this case of ListView/GridView I am unable to find the corresponding chrome and template to change.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:43:22+00:00Added an answer on May 12, 2026 at 9:43 am

    If you have the Windows SDK installed, you can find the XAML source for all default styles (assuming you installed the samples) in:

    %ProgramFiles%\Microsoft
    SDKs\Windows\v6.1\Samples\WPFSamples.zip

    The zip file contains a folder Core which contains AeroTheme, LunaTheme etc which contain the source for default styles. Unfortunately these files are pretty large (~8500 lines for Aero) and not very well structured or formatted (IMO).

    The default control template for a ListViewItem looks like this:

    <ControlTemplate TargetType="{x:Type ListViewItem}">
      <Border CornerRadius="2" SnapsToDevicePixels="True"
              BorderThickness="{TemplateBinding BorderThickness}" 
              BorderBrush="{TemplateBinding BorderBrush}" 
              Background="{TemplateBinding Background}">
        <Border Name="InnerBorder" CornerRadius="1" BorderThickness="1">
          <Grid>
            <Grid.RowDefinitions>
              <RowDefinition MaxHeight="11" />
              <RowDefinition />
            </Grid.RowDefinitions>
    
            <Rectangle Name="UpperHighlight" Visibility="Collapsed" Fill="#75FFFFFF" />
            <GridViewRowPresenter Grid.RowSpan="2" 
                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
          </Grid>
        </Border>
      </Border>
    
      <ControlTemplate.Triggers>
        <Trigger Property="IsMouseOver" Value="True">
          <Setter Property="Background" Value="{StaticResource ListItemHoverFill}" />
          <Setter Property="BorderBrush" Value="#FFCCF0FF" />
          <Setter TargetName="UpperHighlight" Property="Visibility" Value="Visible" />
        </Trigger>
    
        <Trigger Property="IsSelected" Value="True">
          <Setter Property="Background" Value="{StaticResource ListItemSelectedFill}" />
          <Setter Property="BorderBrush" Value="#FF98DDFB" />
          <Setter TargetName="InnerBorder" Property="BorderBrush" Value="#80FFFFFF" />
          <Setter TargetName="UpperHighlight" Property="Visibility" Value="Visible" />
          <Setter TargetName="UpperHighlight" Property="Fill" Value="#40FFFFFF" />
        </Trigger>
    
        <MultiTrigger>
          <MultiTrigger.Conditions>
            <Condition Property="IsSelected" Value="True" />
            <Condition Property="Selector.IsSelectionActive" Value="False" />
          </MultiTrigger.Conditions>
    
          <Setter Property="Background" Value="{StaticResource ListItemSelectedInactiveFill}" />
          <Setter Property="BorderBrush" Value="#FFCFCFCF" />
        </MultiTrigger>
    
        <MultiTrigger>
          <MultiTrigger.Conditions>
            <Condition Property="IsSelected" Value="True" />
            <Condition Property="IsMouseOver" Value="True" />
          </MultiTrigger.Conditions>
    
          <Setter Property="Background" Value="{StaticResource ListItemSelectedHoverFill}" />
          <Setter Property="BorderBrush" Value="#FF98DDFB" />
        </MultiTrigger>
    
        <Trigger Property="IsEnabled" Value="False">
          <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
        </Trigger>
      </ControlTemplate.Triggers>
    </ControlTemplate>
    

    Your best bet for removing all highlighting is probably to replace the ControlTemplate with you own that just includes the GridViewRowPresenter (maybe in a single Border). Don’t forget to include the Trigger that greys the items when the control is disabled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WPF ListView that is bound to a BindingList<T>. The binding works
I have a WPF ListView which repeats the data vertically. I cannot figure out
I have a ListView in WPF that is databound to a basic table that
I have several wpf pages with update/delete/add buttons. I want to display to the
I have a WPF ListView inside StackPanel, with Height=Auto. It's great that it does
I have a WPF ListView inside StackPanel, with Height=Auto. It's great that it does
I have a WPF ListView to wich I bind my collection. Properties of the
I have a WPF (.Net 4) ListView used to navigate a local Windows directory.
I have WPF ListBox which is bound to a ObservableCollection, when the collection changes,
I have a WPF project and I'm trying to setup a NAnt build script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.