How to Remove the Header From a C# WPF ListView

How to Remove the Header From a C# WPF ListView

1 Comment on How to Remove the Header From a C# WPF ListView

To remove a header from a WPF ListView, a style needs to be created targeting the GridViewColumnHeader. The style can be inserted into the controls resources:

<UserControl.Resources>
    <Style x:Key="LVStyle" TargetType="{x:Type GridViewColumnHeader}">
        <Setter Property="Visibility" Value="Collapsed" />
    </Style>
</UserControl.Resources>

Apply the style to the GridView:

<GridView ColumnHeaderContainerStyle="{StaticResource LVStyle}">
.
.
.
</GridView>

You now have a ListView control without the header.

About the author:

Bill Payne started working as a paid professional software developer at the young age of 12 years old developing simple games and other applications for pre-packaged computers. Bill has since developed software for many industries such as direct sales and the the stock market. Bill has now started sharing his many years of software development experience through a blog on the MPSHouse website and one on one lessons.

1 Comment

  1. William Wiltshire  - 28 September , 2011 - 1:05 am
    Reply /

    Well done mate! keep it up!

Leave a comment

Back to Top