Removing the right sided blank column from a ListView in XAML

35 Views Asked by At

I am having trouble removing the blank space (or extra column?) from my ListView looking like following: enter image description here

There seems to be no functional workaround solutions from previous questions on the subject at hand. Is it possible to do purely in XAML?

My XAML for the ListView lying within a Grid:

        <Style TargetType="ListViewItem">
            <Setter Property="HorizontalContentAlignment" Value="Center" />
        </Style>

        <Style BasedOn="{StaticResource {x:Type GridViewColumnHeader}}" TargetType="{x:Type GridViewColumnHeader}">
            <Setter Property="IsHitTestVisible" Value="False" />
        </Style>

<ListView
    Name="lstMovies"
    Grid.Row="1"
    Grid.Column="1"
    FlowDirection="LeftToRight"
    IsSynchronizedWithCurrentItem="True"
    ItemsSource="{Binding Movies}"
    SelectedItem="{Binding CurrentMovie, Mode=TwoWay}"
    SelectionChanged="lstMovies_SelectionChanged"
    SelectionMode="Single">
    <ListView.View>
        <GridView>
            <GridView.Columns>
                <!--  COLUMN WIDTHS FITTED WITH AUTO AND MEASURED WITH PowerToys  -->
                <GridViewColumn
                    Width="235"
                    DisplayMemberBinding="{Binding Path=Title}"
                    Header="Title" />
                <GridViewColumn
                    Width="65"
                    DisplayMemberBinding="{Binding Path=Genre}"
                    Header="Genre" />
                <GridViewColumn
                    Width="76"
                    DisplayMemberBinding="{Binding Path=RunningTime}"
                    Header="Running Time" />
                <GridViewColumn
                    Width="109"
                    DisplayMemberBinding="{Binding Path=Instructor}"
                    Header="Instructor" />
                <GridViewColumn
                    Width="93"
                    DisplayMemberBinding="{Binding Path=PremiereDate}"
                    Header="  Premiere Date  " />
            </GridView.Columns>
        </GridView>
    </ListView.View> </ListView>
0

There are 0 best solutions below