Show/Hide GridView Header in ListView

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-05-04T22:43:43Z Indexed on 2010/05/04 22:48 UTC
Read the original article Hit count: 161

Filed under:
|

I have a ListView in WPF, and I want to hide the headers for the ListView when the List the ItemsSource is bound to is null, and display the headers when the ItemsSource is not null and has at least 1 item in the collection. I have found the code online to hide the ListView headers like this:

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

Thanks for any help!

© Stack Overflow or respective owner

Related posts about wpf

Related posts about listview