0

I have this following code on windows store app project.

<Grid x:Name="minutesGrid" Height="1000" Width="1024" Background="White" >
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="50"/>
                    <RowDefinition Height="100"/>
                    <RowDefinition Height="750"/>
                    <RowDefinition Height="30"/>
                </Grid.RowDefinitions>

                <StackPanel Grid.Row="1" Background="White" Height="50" Orientation="Vertical" >
                    <TextBlock x:Name="minutesTitle" Text="" FontFamily="Segoe UI Semilight" FontWeight="SemiLight" FontSize="24" TextAlignment="Center"  Foreground="{StaticResource BrandBrush}" Margin="0,15,0,0"></TextBlock>
                </StackPanel>
                <StackPanel Grid.Row="2" Background="White">
                    <ScrollViewer HorizontalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible" Height="100">
                        <TextBlock x:Name="minutesDesc" Text=""  FontFamily="Segoe UI Semilight" FontWeight="SemiLight" FontSize="24" Foreground="{StaticResource BrandBrush}" Margin="15,15,0,0" TextWrapping="WrapWholeWords"></TextBlock>
                    </ScrollViewer>
                </StackPanel>
                <StackPanel  Grid.Row="3" Background="White">
                    <PdfViewer:SfPdfViewerControl x:Name="minutesPDF" Canvas.ZIndex="1"/>
                </StackPanel>
            </Grid>

And when i load the pdf it doesnt show the scrollbars or lets me do a scroll either with mousewheel or on tablet with fingers.

This is how i load my file, that is displayed correctly.

var datapdf = await objService.DownloadFileService("teste.pdf",minutes.gappFile._id);

    PdfLoadedDocument pdf = new PdfLoadedDocument(Convert.FromBase64String(datapdf));

    await minutesPDF.LoadDocumentAsync(pdf);
    minutesPDF.ViewMode = Syncfusion.Windows.PdfViewer.PageViewMode.Normal;

Do i need to add something else?

Thought
  • 5,326
  • 7
  • 33
  • 69
  • I'm not familiar with that viewer, but if it doesn't have a `ScrollViewer` already built into the control template, just embed the instance in one and move on with your day. :) – Chris W. Oct 12 '15 at 13:43
  • you usually have to set a width and height for the scrolling to start working – Ken Tucker Oct 12 '15 at 16:38

2 Answers2

0

I think that you've to remove the StackPanel and assign the Grid.Row to the PDFViewer ..

SF Ref : http://help.syncfusion.com/winrt/pdfviewer/getting-started

Nasser AlNasser
  • 1,725
  • 2
  • 11
  • 12
0

Since StackPanel has a default behavior to grow in one direction, scroll of the control included in the StackPanel will not be initiated without the height property being set to it.

Please find the following link which illustrates the reason “Why the control cannot be scrolled inside StackPanel without setting its height property?”

How can I get ScrollViewer to work inside a StackPanel?

Code Snippet: XAML

<Grid x:Name="minutesGrid" Height="1000" Width="1024" Background="White">
    <Grid.RowDefinitions>
        <RowDefinition Height="20"/>
        <RowDefinition Height="50"/>
        <RowDefinition Height="100"/>
        <RowDefinition Height="750"/>
        <RowDefinition Height="30"/>
    </Grid.RowDefinitions>

    <StackPanel Grid.Row="1" Background="White" Height="50" Orientation="Vertical" >
        <TextBlock x:Name="minutesTitle" Text="" FontFamily="Segoe UI Semilight" FontWeight="SemiLight" FontSize="24" TextAlignment="Center" Foreground="{StaticResource BrandBrush}"  Margin="0,15,0,0"></TextBlock>
    </StackPanel>
    <StackPanel Grid.Row="2" Background="White">
        <ScrollViewer HorizontalScrollBarVisibility="Disabled" HorizontalScrollMode="Disabled" VerticalScrollMode="Enabled" VerticalScrollBarVisibility="Visible" Height="100">
            <TextBlock x:Name="minutesDesc" Text=""  FontFamily="Segoe UI Semilight" FontWeight="SemiLight" FontSize="24" Foreground="{StaticResource BrandBrush}" TextWrapping="WrapWholeWords"/>
        </ScrollViewer>
    </StackPanel>
    <StackPanel Grid.Row="3" Background="White">
        <PdfViewer:SfPdfViewerControl x:Name="minutesPDF" Height="750" Canvas.ZIndex="1"></PdfViewer:SfPdfViewerControl>
    </StackPanel>
</Grid>
Community
  • 1
  • 1
SATHISH
  • 42
  • 6