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
<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>