[SOLVED] ScrollViewer doesn't work

Please post public support tickets here. Note: for private support tickets, please send an email to support@cshtml5.com instead.
Matti111
Posts: 8
Joined: Wed Oct 25, 2017 2:56 am

[SOLVED] ScrollViewer doesn't work

Postby Matti111 » Thu Oct 26, 2017 5:57 am

Hello,
I tried to insert a Grid in a ScrollViewer on MainPage (without canvans). The problem is that when I open project in browser, I didn't see any scrollbar and I cant scroll contents. Do you have Idea to solve the issue?

Thanks
Mattia

JS-Support @Userware
Site Admin
Posts: 1142
Joined: Tue Apr 08, 2014 3:42 pm

Re: ScrollViewer doesn't work

Postby JS-Support @Userware » Thu Oct 26, 2017 6:03 am

Hi,

Can you please post the XAML source code?

Thanks.
Regards,
JS-Support

Matti111
Posts: 8
Joined: Wed Oct 25, 2017 2:56 am

Re: ScrollViewer doesn't work

Postby Matti111 » Thu Oct 26, 2017 10:47 pm

The page doesn't scroll down to see all contents


<Grid Background="White">
<StackPanel Orientation="Vertical">
<Grid Grid.Row="0" Height="56">
<Grid.Background>
<LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
<GradientStop Color="#9F86FE" Offset="0"/>
<GradientStop Color="#5784FE" Offset="1"/>
</LinearGradientBrush>
</Grid.Background>

<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Height="36">
...
</StackPanel>
</Grid>

<Grid Grid.Row="1">
<Rectangle Fill="White" Height="180"/>
</Grid>
<Grid Grid.Row="2" Height="1000">
...
</Grid>
<Grid Grid.Row="3" >
..
</Grid>

</StackPanel>
</Grid>

TaterJuice
Posts: 147
Joined: Thu Mar 16, 2017 5:40 am
Contact:

Re: ScrollViewer doesn't work

Postby TaterJuice » Fri Oct 27, 2017 1:57 am

You are not using the ScrollViewer, your content will not scroll.


Just Add ScrollViewer:


Code: Select all

<Grid Background="White">
   <ScrollViewer>
      <StackPanel Orientation="Vertical">
         <Grid Grid.Row="0" Height="56">
            <Grid.Background>
               <LinearGradientBrush EndPoint="0,0.5" StartPoint="1,0.5">
                  <GradientStop Color="#9F86FE" Offset="0"/>
                  <GradientStop Color="#5784FE" Offset="1"/>
               </LinearGradientBrush>
            </Grid.Background>

            <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Height="36">
               <Border
                  VerticalAlignment="Stretch"
                  HorizontalAlignment="Center"
                  Width="55"
                  Background="Green" />
            </StackPanel>
         </Grid>

         <Grid Grid.Row="1">
            <Rectangle Fill="White" Height="180"/>
         </Grid>
         <Grid Grid.Row="2" Height="1000">
            <Border
               VerticalAlignment="Stretch"
               HorizontalAlignment="Center"
               Width="55"
               Background="Green" />
         </Grid>
         <Grid Grid.Row="3" >
            <Border
               Width="300"
               Height="300"
               Background="Red" />
         </Grid>

      </StackPanel>
   </ScrollViewer>
</Grid>



In WPF and SilverLight Scrollviewers can be implemented using attached Properties for ItemsControls, ListViews, ie:

<ListView ScrollViewer.VerticalScrollBarVisibility="Auto" ... />

But they are still separate controls. You need to use the actual ScrollViewer control.

Matti111
Posts: 8
Joined: Wed Oct 25, 2017 2:56 am

Re: ScrollViewer doesn't work

Postby Matti111 » Wed Nov 01, 2017 8:42 am

thanks, it works!


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 4 guests

 

 

cron