When I use a ListView in WPF it always generates one extra column at the end of the ListView. For example, if I define two columns in my listview and when I run it it generates those two columns plus one empty column header. Any idea how I can remove that?
Sample ListView XAML
<ListView ItemsSource="{Binding Path=SearchAttributes}"
DockPanel.Dock="Top">
<ListView.View>
<GridView x:Name="grdView">
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding SearchFieldName}" />
<GridViewColumn Header="Balance" Width="Auto"
CellTemplateSelector="{StaticResource searchFilterDataTemplateSelector}"
>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
Thanks, Jithu
The last column is simply the left over space you need to size the columns to fit exactly in the space. By defining the width as Auto you are making sure that is only as big as possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With