Saturday, September 15, 2012

Silverlight Scrollviewer Mousewheel scrolls only when scrolled on datagrid. Page doesn't scroll when scrolled outside the datagrid

Silverlight Scrollviewer Mousewheel scrolls only when scrolled on datagrid. Page doesn't scroll when scrolled outside the datagrid

Page scrolls without any issue when the mouse is over data grid. If the mouse outside datagrid page doesn't scroll.

<navigation:Page> <Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">      <ScrollViewer x:Name="scrollMainQueue" VerticalScrollBarVisibility="Auto" >         <StackPanel>             <StackPanel>             </StackPanel>             .......             <StackPanel>                 <data:DataGrid AutoGenerateColumns="False" Name="grdWorkingDocs" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="50" Margin="5,0,5,5" CanUserResizeColumns="False" CanUserReorderColumns="False" LoadingRow="grdWorkingDocs_LoadingRow" AlternatingRowBackground="White" RowBackground="White" HorizontalGridLinesBrush="White" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" />             </StackPanel>             </StackPanel>             ......                       </StackPanel>     </ScrollViewer> </Grid> 

scrollMainQueue.SetIsMouseWheelScrollingEnabled(true);


After some research Got the answer. Basically we need to set the background color to the scrollviewer. It worked after that.

<ScrollViewer x:Name="scrollMainQueue" VerticalScrollBarVisibility="Auto" Background="White"> 

Answers & Comments...

Answer: 1

Answer is as mentione above. Applied background color to scrollviewer made is scrollable.

by : user976188http://stackoverflow.com/users/976188




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog