5
votes

I am having trouble getting my long list selector to work properly. When the list is taller than the screen, the long list selector stays static and I am unable to scroll to see all of the items.

Any thoughts?

<phone:PivotItem Header="{Binding Path=LocalizedResources.ApplicationsHeader, Source={StaticResource LocalizedStrings}}" x:Name="applicationsPivotItem">
    <Grid x:Name="applications" Grid.Row="1">
        <phone:LongListSelector x:Name="MainLongListSelector" ItemsSource="{Binding Items}" SelectionChanged="MainLongListSelector_SelectionChanged">
            <phone:LongListSelector.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/>
                        <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                    </StackPanel>
                </DataTemplate>
            </phone:LongListSelector.ItemTemplate>
        </phone:LongListSelector>
    </Grid>
</phone:PivotItem>
3

3 Answers

8
votes

Fix the Height of the Grid

<Grid x:Name="applications" Grid.Row="1" Height="400">
...long list code...
</Grid>
7
votes

I had a similar issue where my panoramaItem was defines as below:

            <phone:PanoramaItem>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <phone:LongListSelector x:Name="SpeciesList" Grid.Row="0">
                        <phone:LongListSelector.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Margin="0,-6,0,12">
                                    <TextBlock Text="{Binding PrimaryName}"/>
                                </StackPanel>
                            </DataTemplate>
                        </phone:LongListSelector.ItemTemplate>
                    </phone:LongListSelector>
                </Grid>
            </phone:PanoramaItem>

By changing the RowDefinition to use * instead of Auto, my scrolling issues was resolved! As shown below.

                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
1
votes

I had the same issue with the LongListSelector not scrolling. In the end it was OpacityMask="White" that was set in LongListSelector that was causing the issue as per this question

Also as per Mattias I didn't have to set a specific Height, as long as the grid RowDefinition was set to *.