4
votes

I have a horizontal list view that scrolls offscreen to the right, such as this:

enter image description here

The problem is, when using touch you can't swipe to scroll the ListView by default, it seems to just grab the ListView item and pull it horizontally a little bit. The only way I can get it to scroll is to click the 5-10 pixels in between each ListViewItem, which is horrible.

Is there a setting to modify this behavior?

My Xaml is basically this:

            <ListView 
                x:Name="listView" Grid.Column="1" IsItemClickEnabled="True"
                ItemsSource="{Binding Assignments}" SelectionMode="None" ItemClick="OnItemClick">
                <ListView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ListView.ItemsPanel>
                <ListView.ItemTemplate>
                    <DataTemplate>
                       <!--cool template to make UI in screenshot-->
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

Should I ask Jerry?

JERRY!!!!

1
What does your itemclick event do? - N_A
It navigates to another page, which I still need. I also need to be able to scroll though. I also tried turning off IsItemClickEnabled, but same result (except my ItemClick doesn't fire). - jonathanpeppers
If you don't want selection then why not use an itemscontrol in a scrollview instead of the listview? - N_A
We want to keep the bounce effect when you click a ListViewItem, but you don't "select" one. - jonathanpeppers

1 Answers

4
votes

Hmm, it was due to having a parent ScrollViewer outside of the ListView, I have a large "panorama" with 4 or 5 controls within it, including the ListView.

I able to fix it by setting this on the ListView:

ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled"