0

PivotItem ScrollViewer 无法向下滚动

无论出于何种原因,当绑定在枢轴项目内的内容长于页面高度时,都不会向下滚动。我尝试在枢轴项内添加一个高度设置为自动的网格,但无济于事。

<controls:PivotItem>
                    <controls:PivotItem.Header>
                        <Grid>
                            <TextBlock Name="TextBlockPropertyDetail" FontSize="31" Text="Property Detail" />
                        </Grid>
                    </controls:PivotItem.Header>
                    <ScrollViewer>
                            <Grid Height="Auto">
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,41,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,77,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,113,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,149,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,185,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" Margin="12,221,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,257,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,293,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,329,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,365,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="Black" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,5,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,41,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,77,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,113,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,149,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,185,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,221,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,257,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,293,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,329,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
                                <TextBlock Foreground="Black" Height="30" HorizontalAlignment="Left" Margin="241,365,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                            </Grid>
                    </ScrollViewer>
                </controls:PivotItem>

感谢您的任何建议。

4

1 回答 1

1

使用网格元素中的 Stackpanel 并尝试此操作。

  <controls:Pivot Title="MY APPLICATION">
        <!--Pivot item one-->
        <controls:PivotItem Header="first" Height="580" >
            <!--Double line list with text wrapping-->
            <ScrollViewer>
                <Grid>
                    <StackPanel>
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" Margin="12,5,279,0" Name="textBlock7" Text="Insured" VerticalAlignment="Top" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-385,0,0" Name="tbkPropertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-350,0,0" Name="tbkCounty" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-315,0,0" Name="tbkParcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="tbkValueRange" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbkCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbkRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-65,0,0" Name="tbkRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-30,0,0" Name="tbkRecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock1" Text="Property Id" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock2" Text="County" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock3" Text="Parcel Number" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock4" Text="Market Value" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock5" Text="Document Image" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textsBlock6" Text="Value Range" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlocsk7" Text="Insured" VerticalAlignment="Top" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock8" Text="Case Number" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBslock9" Text="Recording Date" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBlsock10" Text="Recording Book" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Height="30" HorizontalAlignment="Left" Margin="12,5,0,0" Name="textBsock11" Text="Recording Page" VerticalAlignment="Top" Width="189" Foreground="White" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-380,0,0" Name="tbkPropsertyId" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-345,0,0" Name="tbkCosunty" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-310,0,0" Name="tbkPasrcelNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-275,0,0" Name="tbkMsarketValue" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-240,0,0" Name="tbkDsocumentImage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-205,0,0" Name="s" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-170,0,0" Name="tsbkInsured" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-135,0,0" Name="tbskCaseNo" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-100,0,0" Name="tbskRecordingDate" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-70,0,0" Name="tbksRecordingBook" Text="Loading..." VerticalAlignment="Top" Width="189" />
                        <TextBlock Foreground="White" Height="30" HorizontalAlignment="Left" Margin="241,-35,0,0" Name="tbkRsecordingPage" Text="Loading..." VerticalAlignment="Top" Width="189" />
                    </StackPanel>
                </Grid>
            </ScrollViewer>
        </controls:PivotItem>
 </controls:Pivot>

我希望你能得到解决方案。

于 2013-09-19T05:00:14.537 回答