Mouse Wheel and the ScrollViewer

22. October 2010 03:40

Today I had a problem where the ScrollViewer in my user control would not scroll using the mouse wheel unless it was over a control like a textbox or label... anything other than the grid that is LayoutRoot.  It went something like this:


 <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Padding="1" BorderThickness="0" >

<Grid x:Name="LayoutRoot" >

 

After much trial and error, I figured out that all is needed is a background... it can even be set to Transparent. So, I did this:

 


   <ScrollViewer Grid.Row="0"  VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Padding="1" BorderThickness="0" >
                <Border Background="Transparent">
                    <Grid x:Name="LayoutRoot"  >

 

I know it is simple and probably makes me look like igmo, but I thought it might help somebody else one day. :)


blog comments powered by Disqus

Custom Development

ALL USA BASED DEVELOPERS

 

Coder For Rent is a one-stop shop for all your .Net programming needs.  We can make project-based fixed bids as well as hourly/weekly/monthly quotes.  Our goal is to meet your needs the first time, saving you time and money.

 

Call to speak with an account manager. We take projects of all sizes.

 

713-482-7155 

Contact Us

Call 713-482-7155 
for technical or purchasing support

Freshbooks Rocks

FreshBooks

Silverlight Gantt Chart Control
Silverlight Scheduler Control