列表框无法滚动到底部

时间:2014-02-11 16:09:49

标签: c# xaml listbox telerik windows-phone

我注意到,当我在枢轴内使用列表框时,列表框将不允许我查看列表框中的最后一项,但如果我删除了枢轴,那么列表框工作正常......任何人都知道如何解决这个问题?

编辑:代码

<phone:Pivot HeaderTemplate="{StaticResource detailPivot}" 
             SelectionChanged="Pivot_SelectionChanged"
             Margin="0,10,0,0">
    <phone:PivotItem CacheMode="{x:Null}" x:Name="addressPivot"
                     Header="{Binding LocalizedResources.pivotHeader1, 
                              Source={StaticResource LocalizedStrings}}" >

        <telerikPrimitives:RadDataBoundListBox
            x:Name="AddressListBox"
            ItemsSource="{Binding hereRestAddressDetail}"
            SelectedItem="{Binding hereRestDetail}"
            SelectionChanged="AddressListBox_SelectionChanged" 
            ItemAnimationMode="PlayAll"
            EmptyContent="{Binding}">
            <telerikPrimitives:RadDataBoundListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="0,0,0,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>

                        <Rectangle Grid.Column="0" Grid.RowSpan="2" Width="10">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource PhoneAccentColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <StackPanel Grid.Column="1" Grid.RowSpan="2" >
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding LocalizedResources.by, 
                                                    Source={StaticResource LocalizedStrings}}" 
                                           Style="{StaticResource PhoneTextNormalStyle}"/>
                                <TextBlock Text="{Binding creator}" Margin="-8,0,0,0"
                                           Style="{StaticResource PhoneTextAccentStyle}"/>
                            </StackPanel>
                            <TextBlock Text="{Binding street}"
                                       TextWrapping="Wrap"
                                       Style="{StaticResource PhoneTextNormalStyle}" />
                            <TextBlock Text="{Binding formatedStreet}" 
                                       TextWrapping="Wrap"
                                       Style="{StaticResource PhoneTextSubtleStyle}" />
                        </StackPanel>
                        <Image Source="{Binding ratingButton}" Grid.Column="2"
                               Stretch="Uniform" Width="80" Tag="{Binding Id}"
                               Tap="rate_Tap"/>
                        <TextBlock Text="{Binding ratingValue}" HorizontalAlignment="Center" 
                           TextWrapping="Wrap" Grid.Column="2" Grid.Row="1"
                           Style="{StaticResource PhoneTextSubtleStyle}"/>
                    </Grid>
                </DataTemplate>
            </telerikPrimitives:RadDataBoundListBox.ItemTemplate>

            <telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>
                <telerikCore:RadMoveYAnimation StartY="500" EndY="0" Duration="0:0:1">
                    <telerikCore:RadMoveYAnimation.Easing>
                        <CubicEase EasingMode="EaseIn"/>
                    </telerikCore:RadMoveYAnimation.Easing>
                </telerikCore:RadMoveYAnimation>
            </telerikPrimitives:RadDataBoundListBox.ItemAddedAnimation>

            <telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding myMessage}" TextWrapping="Wrap"
                       HorizontalAlignment="Left" VerticalAlignment="Top"
                       Style="{StaticResource PhoneTextGroupHeaderStyle}"/>
                </DataTemplate>
            </telerikPrimitives:RadDataBoundListBox.EmptyContentTemplate>

        </telerikPrimitives:RadDataBoundListBox>

    </phone:PivotItem>
</phone:Pivot>

1 个答案:

答案 0 :(得分:0)

尝试在VerticalAlignment="Stretch"

上设置RadDataBoundListBox

如果我使用标准ListBox代替RadDataBoundListBox,这对我有用。您是否有理由使用此控件而不是标准控件?