Question: I want to be able to hide the header at the top of each grid column in a WPF ListView.

This is the XAML for my ListView:

```
   <Window x:Class="ListViewTest.Test0.ListViewTest"
   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   Title="Empty ListView Grid" Height="216" Width="435" FlowDirection="LeftToRight" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.IsSharedSizeScope="False">
    <Window.Resources>
        <XmlDataProvider x:Key="CustomersDS" Source="C:\data.xml"/>
    </Window.Resources>

    <ListView Margin="0,0,0,50" ItemTemplate="{DynamicResource CustomerTemplate}" ItemsSource="{Binding Source={StaticResource CustomersDS}, XPath=/Customers/Customer}">
        <ListView.View>
            <GridView>
                <GridViewColumn  DisplayMemberBinding="{Binding XPath=Code}"/>
                <GridViewColumn  DisplayMemberBinding="{Binding XPath=Name}"/>
                <GridViewColumn  DisplayMemberBinding="{Binding XPath=Country}"/>
            </GridView>
        </ListView.View>
    </ListView>

</Window>

```

The data I am binding this to is:

```
 <Customers>
  <Customer>
 <Code>1234</Code>
 <Name>EPI</Name>
 <Country>Sesame Street</Country>
  </Customer>
  <Customer>
 <Code>3234</Code>
 <Name>Paul</Name>
 <Country>United Kingdom</Country>
  </Customer>
 <Customer>
 <Code>3344</Code>
 <Name>Juan</Name>
 <Country>Spain</Country>
  </Customer>
 <Customer>
 <Code>4321</Code>
 <Name>Dodo</Name>
 <Country>Mars</Country>
  </Customer>
</Customers>

```

Answer: 
You can also put the `Style` inline like so:

```
<ListView>
    <ListView.Resources>
        <Style TargetType="GridViewColumnHeader">
            <Setter Property="Visibility" Value="Collapsed" />
        </Style>
    </ListView.Resources>
    <ListView.View>
        <GridView>
            <!-- ... -->
        </GridView>
    </ListView.View>
</ListView>

```

This ensures that the style will only be applied to the desired control (*i.e.*, without unintentionally affecting any additional controls that may be within the **XAML** scope).

**[edit: 2022]** A better solution (not mentioned elsewhere on this page) is to entirely disable the header, rather than collapse it. If you never plan to "uncollapse" (show) the header, there's no reason the WPF layout engine should have to consider it at all:

```
<ListView>
    <ListView.Resources>
        <Style TargetType="GridViewColumnHeader">
            <Setter Property="Template" Value="{x:Null}" />  <!-- way better. -->
        </Style>
    </ListView.Resources>
    <ListView.View>
        <GridView>
            <!-- ... -->
        </GridView>
    </ListView.View>
</ListView>

```

The only difference from above is to set the control `Template` of the sub-scoped `GridViewColumnHeader` instances to `{x:Null}`. This allows WPF to avoid preparing for header instance(s) that are never going to be rendered anyway.
Another way you can apply Ray's solution is like this:

```
<ListView>
    <ListView.View>
        <GridView>
            <GridView.ColumnHeaderContainerStyle>
                <Style TargetType="GridViewColumnHeader">
                    <Setter Property="Visibility" Value="Collapsed" />
                </Style>
            </GridView.ColumnHeaderContainerStyle>
        </GridView>
    </ListView.View>
</ListView>

```

The solution sets the style property directly rather than creating a resource that is automatically applied. Not saying it's better, just another way...