I know this must be obvious but I am starting with WPF and I am stuck:
I’ve the following ListView (in the second row of the main grid on the page), content is showing up but the header is not!
<ListView Grid.Row="1" Name="container" ItemsSource="{Binding MyCollection}" >
<ListView.View>
<GridView>
<GridViewColumn Width="50" Header="A" DisplayMemberBinding="{Binding A}"/>
<GridViewColumn Width="50" Header="B" DisplayMemberBinding="{Binding B}"/>
<GridViewColumn Width="50" Header="C" DisplayMemberBinding="{Binding C}"/>
</GridView>
</ListView.View>
</ListView>
Any help appreciated!
EDIT:
Thanks to Roel I was able to find a style in the resourceDictionary casuing this problem:
<Style TargetType="{x:Type ListView}" BasedOn="{StaticResource {x:Type ListBox}}">
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ScrollViewer Margin="{TemplateBinding Padding}" VerticalScrollBarVisibility="Visible">
<WrapPanel IsItemsHost="True" MinWidth="100" Width="{Binding ActualWidth,RelativeSource={RelativeSource AncestorType=ScrollContentPresenter}}">
</WrapPanel>
</ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
How can I keep that style for the rest of the project without applying it to this specific listView?
you can overwrite the style just for that listview. this is probably the easiest way:
hope this helps!