当前位置:编程学习 > wap >>

Listpicker在ListBox中显示不了下拉菜单

 大家好,小弟有个问题。 Listpicker在ListBox中显示不了下拉菜单,在<grid>中就能显示。如果显示 怎样才能在显示的情况下不遮挡下放的控件呀?谢谢大家帮忙解决下!!拜托 --------------------编程问答-------------------- 改用contextmenu吧。 --------------------编程问答-------------------- 不显示,是不是高度限制了,所以显示不全,或者数据没绑定上。设置Listpicker的ZIndex --------------------编程问答-------------------- Listpicker 的 弹出选择菜单 如果没有改变控件的高度 那List是不知道的。 --------------------编程问答-------------------- --------------------编程问答-------------------- 同问



   <ListBox x:Name="payTypeListBox" Grid.Row="1" ItemsSource="{Binding}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="0,0,0,5" Width="450" VerticalAlignment="Center" ShowGridLines="True" HorizontalAlignment="Center">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="0.094*"/>
                                <RowDefinition Height="150"/>
                                <RowDefinition Height="0.094*"/>
                                <RowDefinition Height="0.491*"/>
                                <RowDefinition Height="0.226*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="0.3*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock Margin="12,0,0,5" TextWrapping="Wrap" Text="名称" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5,0,0,5" TextWrapping="Wrap" Text="{Binding PayTypeName}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Margin="12,0,0,5" Grid.Row="1" TextWrapping="Wrap" Text="预算类别" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <!--TextBlock Grid.Column="1" Margin="5,0,0,5" Grid.Row="1" TextWrapping="Wrap" Text="{Binding BudgetTypeName}" HorizontalAlignment="Left" VerticalAlignment="Center"/-->

                            <toolkit:ListPicker x:Name="budgetTypeTempListPicker" Grid.Row="1" Grid.Column="1" FullModeHeader="Cities" CacheMode="BitmapCache" ItemsSource="{Binding}" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource MyListPicker}" ExpansionMode="FullScreenOnly">
                                <toolkit:ListPicker.FullModeItemTemplate>
                                    <DataTemplate>
                                        <Border Style="{StaticResource MyBorder}">
                                            <StackPanel Orientation="Horizontal">
                                                <TextBlock Text="{Binding BudgetTypeName}" VerticalAlignment="Center"/>
                                            </StackPanel>
                                        </Border>
                                    </DataTemplate>
                                </toolkit:ListPicker.FullModeItemTemplate>

                                <toolkit:ListPicker.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding BudgetTypeName}" VerticalAlignment="Center"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </toolkit:ListPicker.ItemTemplate>
                            </toolkit:ListPicker>


                            <TextBlock Margin="12,0,0,5" Grid.Row="2" TextWrapping="Wrap" Text="默认金额" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5,0,0,5" Grid.Row="2" TextWrapping="Wrap" Text="{Binding DefultAmount}" HorizontalAlignment="Left" VerticalAlignment="Center" TextAlignment="Right"/>
                            <CheckBox Content="是否启用" Margin="0" Grid.Row="4" HorizontalAlignment="Left" Width="200" d:LayoutOverrides="GridBox" VerticalAlignment="Center" Grid.ColumnSpan="2" IsChecked="{Binding IsUsable}" />
                            <RadioButton Content="固定支出" Margin="0" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" Width="200" Grid.ColumnSpan="2" />
                            <RadioButton Content="额外支出" Grid.Column="1" Grid.ColumnSpan="1" Margin="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                        </Grid>
                    </DataTemplate>
                </ListBox.ItemTemplate>

            </ListBox>
--------------------编程问答-------------------- 我已经搞定了。

 <ListBox Height="Auto" HorizontalAlignment="Left" Margin="6,6,0,0" Name="listBox1" VerticalAlignment="Top" Width="Auto" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Vertical" Width="400">
                                <TextBlock Text="{Binding PayTypeName}"/>
                                <toolkit:ListPicker ItemsSource="{Binding BudgetTypeNameTemp}" SelectedItem="{Binding BudgetTypeName}">
                                    <toolkit:ListPicker.ItemTemplate>
                                        <DataTemplate>
                                            <TextBlock Text="{Binding}"/>
                                        </DataTemplate>
                                    </toolkit:ListPicker.ItemTemplate>
                                </toolkit:ListPicker>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>

--------------------编程问答-------------------- 已经搞定了,呵呵,顶! --------------------编程问答--------------------
是不是控件的样式或者层级错了导致的?
补充:移动开发 ,  Windows Phone
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,