Home > DeveloperSection > Forums > TextBox Scrolling in Windows Phone App not working
Royce Roy
Royce Roy

Total Post:134

Posted on    April-14-2015 1:22 AM

 XAML XAML  Windows Phone 

 1 Reply(s)
 543  View(s)
Rate this:
I have a page in a Windows Phone app. This page is rather "tall". For that reason, the entire page is wrapped in a ScrollViewer. Towards the bottom of the page is a TextBox. This TextBox is intended to be a multi-line TextBox with TextWrapping="Wrap". I need for the user to be able to scroll up-and-down within the TextBox to see the content they have typed. However, I am unable to scroll within the TextBox itself. Instead, when I attempt to scroll, the entire page scrolls. How do I remedy this? I tried adding ScrollViewer.VerticalScrollBarVisibility="Auto" however, that does not seem to work either. Here is an exerpt of my XAML
<Grid x:Name="LayoutRoot" Background="{StaticResource PhoneBackgroundBrush}">
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="*"/>
  <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
    <TextBlock x:Name="ApplicationTitle" Text="APPNAME" Style="{StaticResource PhoneTextNormalStyle}" />
    <TextBlock x:Name="PageTitle" Text="{Binding Path=PageTitle}" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
  <ScrollViewer Grid.Row="1">
    <Grid x:Name="ContentPanel" Margin="12,0,12,0">
      <TextBox x:Name="bodyTextBox" Text="{Binding Path=Body, Mode=TwoWay}" Height="145"  TextWrapping="Wrap" InputScope="Text" Grid.Row="6" MaxLength="1024" Margin="0,-8,0,0" />

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    April-14-2015 9:17 AM

In my experience, this is usually caused by incorrectly using an "auto" height tag or a "starSizing" height tag somewhere. I would try setting fixed heights for relevant elements (especially your RowDefinition) and see that helps

Don't want to miss updates? Please click the below button!

Follow MindStick