none
[W8.1][XAML]Not Able To Scroll List WithIn Another List Windows Store Apps RRS feed

  • Question

  • Hi,

    I have A List Box Control With Horizontal Scrolling and Vertical scrolling is Disable, In That ListBox there is a Textblock and another ListView control with vertical scrolling enable.

    My Problem is That I am not able to Scroll the ListView With in the ListBox.

    Here is My Code:----

     

    <ListBox x:Name="ClientTasks" VerticalAlignment="Top" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollMode="Disabled" ScrollViewer.HorizontalScrollMode="Enabled" SelectionMode="Single" HorizontalAlignment="Left" ItemContainerStyle="{StaticResource ClientListBoxItemStyle}" ItemTemplate="{StaticResource ClientTasksDatatemplate}" ><ListBox.ItemsPanel><ItemsPanelTemplate><VirtualizingStackPanel Orientation="Horizontal"/></ItemsPanelTemplate></ListBox.ItemsPanel></ListBox>

    Here is My DataTemplate

    <DataTemplate x:Name="ClientTasksDatatemplate">
    		<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    		<Border BorderThickness="1,0,1,1" BorderBrush="{StaticResource ApplicationBorderBrush}"  Width="441" Margin="0,0,15,0">
    		<Grid Background="White">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="Auto"/>
    				<RowDefinition Height="*"/>
    			</Grid.RowDefinitions>
     
    				<Border  Grid.Row="0" BorderThickness="0,0,0,1" BorderBrush="{StaticResource ApplicationBorderBrush}">
    			<Grid>
    				<Grid.ColumnDefinitions>
    					<ColumnDefinition Width="*"/>
    					<ColumnDefinition Width="Auto"/>
    				</Grid.ColumnDefinitions>
    				<TextBlock Text="Missing Documents" Foreground="{StaticResource LargeTextForeground}" FontSize="22" VerticalAlignment="Center" Margin="10,0,0,0"/>
    				<Border Grid.Column="1" BorderThickness="1,0,0,0" BorderBrush="{StaticResource ApplicationBorderBrush}" HorizontalAlignment="Center">
    					<Image Width="30" Height="30" Margin="10" Source="/Assets/Images/text.png"/>
    				</Border>
    			</Grid>
    				</Border>
    			
    				<Grid Grid.Row="1">
    						<ScrollViewer VerticalScrollBarVisibility="Hidden">
    					<uc:TaskListsUserControl/>
    						</ScrollViewer>
    					</Grid>
    		</Grid>
    		</Border>
    		</Grid>
    	</DataTemplate>
                          

    Here is My TaskList User Control

    <UserControl
    	x:Class="WinRT.Views.UserControls.TaskListsUserControl"
    	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    	xmlns:local="using:Mydesq.Client.WinRT.Views.UserControls"
    	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    	mc:Ignorable="d"
    	d:DesignHeight="300"
    	d:DesignWidth="400">
    	
    	<Grid>
     
    		<ListView Grid.Row="1" Name="ClientTasksList" SelectionMode="None" HorizontalAlignment="Stretch" 
    							 ScrollViewer.VerticalScrollBarVisibility="Hidden" IsItemClickEnabled="True"
    							 ItemsSource="{Binding Relations}"  ScrollViewer.VerticalScrollMode="Enabled"
    							 ItemContainerStyle="{StaticResource ClientListViewItemStyle}">
    			<ListView.ItemTemplate>
    				<DataTemplate>
    					<Border BorderThickness="0,0,0,1" BorderBrush="{StaticResource ApplicationBorderBrush}" Padding="10">
    						<Grid>
    							<Grid.ColumnDefinitions>
    								<ColumnDefinition Width="Auto"/>
    								<ColumnDefinition Width="*"/>
    							</Grid.ColumnDefinitions>
    							<StackPanel Grid.Column="0" Width="60" Height="60" Background="{StaticResource ApplicationPageHeaderBackgroundThemeBrush}" VerticalAlignment="Top" HorizontalAlignment="Center">
    								<Image/>
    							</StackPanel>
     
    							<Grid Grid.Column="1" Margin="10,0,0,0">
    								<Grid.RowDefinitions>
    									<RowDefinition Height="Auto"/>
    									<RowDefinition Height="Auto"/>
    									<RowDefinition Height="Auto"/>
    								</Grid.RowDefinitions>
    								<TextBlock Text="text1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" FontSize="20" Foreground="{StaticResource MydesqLargeTextForeground}"/>
    								<StackPanel Grid.Row="1" Orientation="Horizontal">
    									<Image Width="20" Height="20" VerticalAlignment="Center" Source=""/>
    									<TextBlock Text="White" FontSize="16" VerticalAlignment="Center" Foreground="{StaticResource MydesqLargeTextForeground}" Margin="5,0,0,0"/>
    								</StackPanel>
     
    								<StackPanel Grid.Row="2" Orientation="Horizontal">
    									<Image Width="20" Height="20" VerticalAlignment="Center" Source=""/>
    									<TextBlock Text="14.03.2015" FontSize="16" VerticalAlignment="Center" Foreground="{StaticResource MydesqLargeTextForeground}" Margin="5,0,0,0"/>
    								</StackPanel>
    							</Grid>
     
     
    						</Grid>
    					</Border>
    				</DataTemplate>
    			</ListView.ItemTemplate>
    		</ListView>
     
        </Grid>
    	
       
    </UserControl>



    Friday, May 29, 2015 4:49 AM

Answers

  • Here's an obvious question: why would you want to put a list inside a list? Does that actually make sense?

    There are better ways to split information, and having a list inside a list will make for a poor user experience in the end. You should try to use a pivot or a hub or something similar instead.

    To answer your question: one of the lists captures the gesture event and the other list will not get it, thus the scrolling never actually happened in one of the lists.

    Tuesday, June 2, 2015 8:58 AM

All replies

  • I will test it.
    Monday, June 1, 2015 2:13 PM
  • Hi ved3397,

    The Building Windows Store apps with C# or VB forum is retiring! I'll move this to the Building Universal Windows apps forum for you. Please read Welcome to the Developing Universal Windows apps forum! and Guide to posting: subject line tags

    >>My Problem is That I am not able to Scroll the ListView With in the ListBox.

    Since you do not show all your code in here, so I have done a simple test with your xaml code, but I can not reproduce your issue in my side, I can scroll the ListView vertically inside the ListBox. Could you please try to post a simple reproduced project in here(xaml code+cs code)? 
    Thanks for your understanding.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, June 2, 2015 6:13 AM
    Owner
  • Here's an obvious question: why would you want to put a list inside a list? Does that actually make sense?

    There are better ways to split information, and having a list inside a list will make for a poor user experience in the end. You should try to use a pivot or a hub or something similar instead.

    To answer your question: one of the lists captures the gesture event and the other list will not get it, thus the scrolling never actually happened in one of the lists.

    Tuesday, June 2, 2015 8:58 AM