Removing a WPF ListView's "classic" indented border Removing a WPF ListView's "classic" indented border wpf wpf

Removing a WPF ListView's "classic" indented border


Don't know if its a former version of WPF, but on Visual studio 2008 the following is enough to remove all borders and colors of a listview control

<ListView Background="Transparent" BorderThickness="0">


For a lot of the built-in WPF control styles, you need to override the ControlTemplate to get this level of control over the rendering.

Here is the MSDN page that provides the ListView ControlTemplate, with instructions on how to use it -- basically you are inserting local copies of all the styles for the ListView control, which then override the default control look and feel.

To get rid of the indented border, you will need to find the specific border definition in the control template that is causing the behavior you want to modify; there are several of them, but it should be easy enough to figure out which one is causing the indentation using trial and error and/or Snoop.


listview1.BorderStyle = BorderStyle.None