user3342256
user3342256

Reputation: 1290

ListView Not Showing Horizontal Scrollbar

I have a ListView nested in a in a simple WPF app. I have the horizontal scrolling property enabled on the ListView, but it never activates so items continue to be truncated horizontally. Hoping someone can point out any obvious errors. XAML:

<ListView Name="MyListView" ItemsSource="{Binding Path=SoftwareUpdates}" HorizontalAlignment="Left" MinHeight="55" Height="Auto" Margin="9,197,0,0" VerticalAlignment="Top" Width="570" Grid.RowSpan="2" Visibility="{Binding IsChecked,ElementName=DetailsCheckBox,Converter={StaticResource b2v}}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
        <ListView.View>
            <GridView>
                <GridViewColumn Width="568" Header="Missing Updates:" DisplayMemberBinding="{Binding Path=Name}" />
            </GridView>
        </ListView.View>
    </ListView>

Upvotes: 1

Views: 2172

Answers (1)

David E
David E

Reputation: 1444

Changing the Width of the column to Auto (or equivalently, deleting the Width style, assuming there is no default style) gives the required result.

The key is that the data that you don't want to truncate is inside the column, which is truncated in the above code at Width 568... But this Width actually needs to be able to stretch indefinitely with the data so that it can be scrolled by the scroll bar on the ListView.

Upvotes: 2

Related Questions