Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5989061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:02:49+00:00 2026-05-22T23:02:49+00:00

I have the following XAML markup in a WP7 UserControl. My problem is that

  • 0

I have the following XAML markup in a WP7 UserControl. My problem is that when my ListBox has more items than will fit on a page it will not scroll properly. I can scroll the list by panning upwards with my finger but as soon as I remove my finger it jumps back to the top of the list (if the list is very long then the scrolling will not even work to this limited extent).

I have tried numerous different layouts with no success e.g. Wrapping ListBox in ScrollViewer, utilising StackPanel instead of Grid, removing the WrapPanel and replacing it with a grid.

Other similar questions suggested removing StackPanel (which I did but made no difference) or using ScrollViewer (which did not work).

The Page that hosts the UserControl uses a GestureListener – I removed that and it still made no difference.

<Grid x:Name="LayoutRoot"
      Background="SteelBlue">

    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <!--<TextBlock Grid.Row="0"
               Text="Search"
               Style="{StaticResource PhoneTextTitle2Style}" />-->

    <Grid Grid.Row="0">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Text="Search Type"
                   Grid.Column="0"
                   VerticalAlignment="Center" />

        <RadioButton Content="RMB/RSD"
                     Grid.Column="1"
                     IsChecked="{Binding Path=SearchType, Converter={StaticResource enumBooleanConverter}, ConverterParameter=RMB, Mode=TwoWay}" />

        <RadioButton Content="Name"
                     Grid.Column="2"
                     IsChecked="{Binding Path=SearchType, Converter={StaticResource enumBooleanConverter}, ConverterParameter=Name, Mode=TwoWay}" />
    </Grid>

    <Grid Grid.Row="1">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Text="Search Term"
                   Grid.Column="0"
                   VerticalAlignment="Center" />

        <TextBox Grid.Column="1"
                 Text="{Binding SearchTerm, Mode=TwoWay}"
                 InputScope="{Binding SearchTermInputScope}">
            <i:Interaction.Behaviors>
                <b:SelectAllOnFocusBehavior />
            </i:Interaction.Behaviors>
        </TextBox>

    </Grid>

    <Button Grid.Row="2"
            Content="Find"
            cmd:ButtonBaseExtensions.Command="{Binding FindDeliveryPointsCommand}" />

    <ListBox Grid.Row="3"
             ItemsSource="{Binding SearchResults}"
             ScrollViewer.VerticalScrollBarVisibility="Auto">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <toolkit:WrapPanel Orientation="Horizontal"
                                   Width="480"
                                   Background="{Binding RMB, Converter={StaticResource alternateColorConverter}}">
                    <TextBlock Text="{Binding RMB}"
                               FontSize="26"
                               Foreground="Navy"
                               Padding="5"
                               Width="60" />
                    <TextBlock Text="{Binding HouseholdName}"
                               FontSize="26"
                               Foreground="Navy"
                               Padding="5"
                               Width="420" />
                    <TextBlock Text="{Binding StreetWithRRN}"
                               FontSize="26"
                               Foreground="Navy"
                               Padding="5" />
                    <TextBlock Text="{Binding Street.Locality.Name}"
                               FontSize="26"
                               Foreground="Navy"
                               Padding="5" />
                </toolkit:WrapPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Grid>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:02:50+00:00Added an answer on May 22, 2026 at 11:02 pm

    Specify ListBox.Height – something like Height=”200″. As it is now, ListBox expands automatically to accomodate all loaded items and it grows out of the screen. As a result you get large page with no scroller.

    When you add ListBox.Height, the ListBox area won’t grow. Instead ListBox ScrollViewer will be activated and you’ll get the effect you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following XAML: <UserControl x:Class=EMS.Controls.Dictionary.TOCControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:vm=clr-namespace:EMS.Controls.Dictionary.Models xmlns:diagnostics=clr-namespace:System.Diagnostics;assembly=WindowsBase x:Name=root > <TreeView
I have the following XAML, that does all that it is supposed to, except
I have the following XAML markup in a WPF DataGrid: <DataGrid ItemsSource={Binding ResultList} Grid.ColumnSpan=4
I have the following code: XAML: <UserControl x:Class=RBSoft.WPF.RedConsoleViewer xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 mc:Ignorable=d d:DesignHeight=355
I have a user control that inside has a TextBlock (textmsg), the following is
How to get scroll up/down or left/right event for scrollViewer/Listbox? I have following XAML.
I have the following XAML: <UserControl x:Class=WpfWindow.MyControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:mc=http://schemas.openxmlformats.org/markup-compatibility/2006 xmlns:d=http://schemas.microsoft.com/expression/blend/2008 mc:Ignorable=d d:DesignHeight=300 d:DesignWidth=300>
I have the following main.xaml and usercontrol. I need to place several times the
I have the following XAML: <TextBlock Text={Binding ElementName=EditListBox, Path=SelectedItems.Count} Margin=0,0,5,0/> <TextBlock Text=items selected> <TextBlock.Style>
I have following XAML: <TextBlock HorizontalAlignment=Center VerticalAlignment=Center FontSize=10 FontFamily=Arial Foreground=#414141> <Run Text={Binding LoadsCount} />

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.