RSS

WP7 ListBox does not scroll

22 May

If you have the problem that your ListBox, created in XAML, does not have the ability to scoll (even though you have put it into scope of a ScollViewer) you may have the case that you put your ListBox into a StackPanel. There it would not scroll.

You may have following 2 cases:

<StackPanel>
    <Label Content="MyList"/>
    <ListBox ItemsSource="{Binding MySuperDuperList}"/>
</StackPanel>
<StackPanel>
    <Label Content="MyList"/>
    <ScrollViewer>
        <ListBox ItemsSource="{Binding MySuperDuperList}"/>
    </ScrollViewer>
</StackPanel>

To solve the problem put the ListBox into scope of a Grid, then it will scoll again.

<StackPanel>
    <Label Content="MyList"/>
    <Grid>
        <ListBox ItemsSource="{Binding MySuperDuperList}"/>
    </Grid>
</StackPanel>
Advertisements
 
1 Comment

Posted by on May 22, 2011 in WP7

 

Tags: , ,

One response to “WP7 ListBox does not scroll

  1. Danilo (@dbrgn)

    January 5, 2012 at 00:13

    I wish I had seen this before, it would have saved me a whole lot of debugging…

     

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: