locked
List box not scrolling inside a warp panel in windows 8.1 store app using c#.

    Question

  • Hi All,

    List box vertical scrolling is not working if we use silver light custom warp panel in windows 8.1 store app in c#.  My code is given bellow

       <ListBox Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Visibility="Collapsed" Name="lstEmoji" VerticalAlignment="Top" HorizontalAlignment="Left"  Margin="70,100,0,0" Grid.Row="0" Grid.RowSpan="2"  Grid.ColumnSpan="4" SelectionChanged="lstEmoji_SelectionChanged">
                <ListBox.ItemsPanel>                
                    <ItemsPanelTemplate>
                        <yy:WrapPanel Orientation="Horizontal" FlowDirection="LeftToRight" Margin="5"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemTemplate>
                    <DataTemplate>                    
                            <StackPanel Orientation="Vertical" >
                            <!--<Border VerticalAlignment="Top" HorizontalAlignment="Left" Height="80" Width="80" BorderBrush="Blue" BorderThickness="3">-->
                            <Image Name="imgEmoji" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding EmojiImages}" Stretch="Fill" Height="80" Width="80"></Image>
                            <!--</Border>-->
                            <TextBlock Name="txtEmoji" Text="{Binding EmojisName}" Height="auto" Width="auto" Visibility="Collapsed"></TextBlock>
                            </StackPanel>                
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
           

    I also search it over Google but many of thread said that please set the property IsItemsHost to true but this is not support in store app.How can I resolve it? Please reply.

    ThanQ

    Ganesh

    Monday, June 30, 2014 8:52 AM

Answers

  • Hi All,

    I was resolved it with changes the design given bellow

     <ListView Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Visibility="Collapsed" Name="lstEmoji" VerticalAlignment="Top" HorizontalAlignment="Left"  Margin="70,100,0,0" Grid.Row="0" Grid.RowSpan="2"  Grid.ColumnSpan="4" SelectionChanged="lstEmoji_SelectionChanged">
                <ListView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid Orientation="Horizontal"  Margin="5"></WrapGrid>
                        <!--<yy:WrapPanel Orientation="Horizontal"  FlowDirection="LeftToRight" Margin="5"/>-->
                    </ItemsPanelTemplate>
                </ListView.ItemsPanel>
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" >
                            <!--<Border VerticalAlignment="Top" HorizontalAlignment="Left" Height="80" Width="80" BorderBrush="Blue" BorderThickness="3">-->
                            <Image Name="imgEmoji" VerticalAlignment="Top" HorizontalAlignment="Left" Source="{Binding EmojiImages}" Stretch="Fill" Height="80" Width="80"></Image>
                            <!--</Border>-->
                            <TextBlock Name="txtEmoji" Text="{Binding EmojisName}" Height="auto" Width="auto" Visibility="Collapsed"></TextBlock>
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

    I think some problem in warp panel.

    ThanQ

    Ganesh

    Monday, June 30, 2014 12:24 PM