WPF ListView – Hide Column Headers by simple Style

WPF ListView is a very popular tool for showing list of items. Sometimes we need to hide the ListView column headers and only show the list of items.

But ListView does not provide any default behavior or property for hiding the column headers.

By applying a simple style you can hide the column headers of WPF ListView.

	<ListView x:Name="ListView1">
			<Style TargetType="GridViewColumnHeader">
				<Setter Property="Visibility" Value="Collapsed" />
					<GridViewColumn DisplayMemberBinding="{Binding ID}" />
					<GridViewColumn DisplayMemberBinding="{Binding Name}" />

In the line 4, I have created a simple style with TargetType to ‘GridViewcolumnHeader’ and set the GridViewColumnHeader visibility to collapsed.

This style is automatically applied to every GridViewColumnHeader used in the ListView and hides the column headers of every ListView column.

WPF Hide ListView ColumnHeader