WPF List Deletes Extra Column

When I use ListView in WPF, it always generates one extra column at the end of the ListView. For example, if I define two columns in my list, and when I run it, it generates these two columns plus one empty column heading. Any idea how I can remove this?

ListView XAML Example

<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

+5
source share
2 answers

The last column is just the left space needed to make the size of the columns fit exactly in space. By defining the width as Auto, you will see that it is as large as possible.

+1
source

GridView , - AutoGenerateColumns - "False"

-2

All Articles