ScrollViewer not scrollable?

I am currently working on yet another application. In that application I have two pages, the MainPage where I can choose a certain phrase. Choosing one of them navigates me to my second page, where I have three TextBlocks. The length of the text varies, depending on the phrase I chose in the first page.

No problem, I thought. I’ll just put my TextBlocks in a StackPanel, And I nicely can put a ScrollViewer around the TextBlocks:

Well, what sounded nice in theory did not work out. When I ran the application, I could see there is a ScrollViewer, but somehow it just bounced back to the start point whenever I tried to scroll.

The solution was quite easy in the end. I replaced the StackPanel with a Grid:

Now I can scroll in the two TextBlocks that I need.


To be continued…

Addition: Yesterday I got this comment on this blog post:

“You limited the textbox height, but you wanted to limit the view of it.

So you could also set the height on the scrollviewer, and remove it (so it will be auto) on the textblocks. Let’s you still use the stackpanel. :)



So I tried that. And although I was happy with the solution I came up with, I like this solution as well. It just works:

Thank you @David_TK.


To be continued…



  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: