Show / hide title of GridView in ListView

I have a ListView in WPF and I want to hide the headers for the ListView when the List the ItemsSource is null bound and displays the headers when the ItemSource is not null and has at least 1 item in the collection.I found some code online to hide the headers ListView as follows:

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

      

Thanks for any help!

+2


a source to share





All Articles