Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my list view inside the split view is not scrolling.

XML
<SplitView ScrollViewer.IsVerticalRailEnabled="True" BorderBrush="White" BorderThickness="1" x:Name="windowssplit1" DisplayMode="Overlay" Margin="40,-95,0,-200" Width="340" HorizontalAlignment="Left" x:FieldModifier="Public" Grid.RowSpan="2">
            <SplitView.Pane>
                <!--<Grid removed="Gray" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.IsVerticalScrollChainingEnabled="True">-->
                    <StackPanel removed="Gray" BorderBrush="White" BorderThickness="1" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.IsVerticalScrollChainingEnabled="True" Margin="0,49,0,-162">
                    <TextBlock Text="All Ages" Margin="20,10,0,10" Foreground="White" FontSize="20" />
                    <Border BorderThickness="0.4" BorderBrush="White" Margin="20,0,0,10" Width="280" HorizontalAlignment="Left"/>
                    <ListView x:Name="filterlist1" Margin="10,0,0,0" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.IsVerticalRailEnabled="True" SelectionChanged="filterlist_SelectionChanged">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock FontSize="18" Margin="0,10,0,0" Foreground="White" Text="{Binding CategoryName}"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                <!--</Grid>-->
                </StackPanel>
            </SplitView.Pane>
        </SplitView>

 <SplitView x:Name="PhoneSplitView" Margin="0,50,0,0" DisplayMode="Overlay" Width="250" HorizontalAlignment="Left" x:FieldModifier="Public" Grid.ColumnSpan="2" Grid.RowSpan="2">
            <SplitView.Pane>
                <!--<Grid removed="Gray">-->
                <StackPanel removed="Gray" ScrollViewer.VerticalScrollMode="Enabled">
                    <TextBlock Text="Refine" x:Name="refine" Margin="10,0,0,10" Foreground="White"/>
                    <Border BorderThickness="0.4" x:Name="border1" BorderBrush="White" Margin="10,0,0,0" Width="200" HorizontalAlignment="Left"/>
                    <TextBlock Text="Sort By :" Margin="10,15,0,0" Foreground="White" FontSize="13" FontWeight="Light" />
                    <ListView x:Name="sortbylist" SelectionChanged="sortbylist_SelectionChanged">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Foreground="White" x:Name="dsasd" Text="{Binding SortName}"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>

                    <Border BorderThickness="0.4" x:Name="border2" BorderBrush="White" Margin="10,10,0,0" Width="200" HorizontalAlignment="Left"/>
                    <TextBlock Text="Filter :" Margin="10,15,0,0" x:Name="refine1" Foreground="White" FontSize="13" FontWeight="Light" />
                    <ListView x:Name="filterlist" SelectionChanged="filterlist_SelectionChanged" ScrollViewer.IsVerticalRailEnabled="True">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Foreground="White" Text="{Binding CategoryName}"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>

                    <Border BorderThickness="0.4" x:Name="border3" BorderBrush="White" Margin="10,10,0,0" Width="280" HorizontalAlignment="Left"/>
                    <TextBlock x:Name="langlist2" Text="Language" Margin="10,15,0,0" Foreground="White" FontSize="13" FontWeight="Light"/>
                    <ListView x:Name="langlist" ScrollViewer.VerticalScrollMode="Enabled" ScrollViewer.IsVerticalRailEnabled="True" SelectionChanged="langlist1_SelectionChanged">
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Foreground="White" Text="{Binding SortName}"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>
                    </ListView>
                <!--</Grid>-->
                </StackPanel>
            </SplitView.Pane>
        </SplitView>


The List View present in the Bolded Code must Scroll how this can be done, Help me....
How to make the List scroll.

Reference Image : Image1

Image2

What I have tried:

By some refrence i tried by removing Stack Panel in the Splitview.Pane and replaced it with Grid, but it not helped me.
Posted
Updated 14-Jul-16 21:57pm
v2
Comments
johannesnestler 17-Mar-16 10:25am    
I don't see any bolded code.. - but after a quick look I'd guess you can not scroll because your stack-panel will give the listview whatever size it wants, to get the scrolling it needs to be "limited", so just set a maxsize on the ListView, or use a grid with fixed rows/colums instead of the stackpanel, etc...
Mohan Rajesh Komatlapalli 17-Mar-16 12:51pm    
ok, I had done the same thing given MaxHeight and MaxWidth to the list, it is Showing Scroll Bar and also scrolling, But not showing all the contents got from DB. Totally I bought 19 items from DB and given to ListView, it only showing 14 items in the list, it is showing 10 items first, after scrolling it is completely showing 14 items out of 19.remaining items are not being shown....

1 solution

I had modified the Code Snip as below, Placed a ScrollViewer inside the SplitView.Pane and Modified the Margin values.

Code for Windows 10 PC App
XML
<splitview borderbrush="White" borderthickness="1" x:name="windowssplit1" displaymode="Overlay" margin="310,95,0,100" x:fieldmodifier="Public" grid.rowspan="2" xmlns:x="#unknown">
            <splitview.pane>
                <scrollviewer x:name="scrol2" isverticalrailenabled="True">
                    <stackpanel background="Gray" borderbrush="White" borderthickness="1">
                        <textblock text="All genere" margin="20,10,0,10" foreground="White" fontsize="20" />
                        <border borderthickness="0.4" borderbrush="White" margin="20,0,0,10" width="280" horizontalalignment="Left" />
                        <listview x:name="filterlist1" margin="10,-10,0,0" selectionchanged="filterlist_SelectionChanged">
<listview.itemtemplate>
<datatemplate>
 <textblock fontsize="18" margin="0,5,0,0" foreground="White" text="{Binding CategoryName}" />
 </datatemplate>
</listview.itemtemplate>
                        </listview>
                    </stackpanel>
                </scrollviewer>
            </splitview.pane>
        </splitview>


Code for Windows 10 Phone App

XML
<splitview x:name="PhoneSplitView" margin="0,50,0,0" displaymode="Overlay" width="250" scrollviewer.verticalscrollmode="Enabled" scrollviewer.isverticalrailenabled="True" horizontalalignment="Left" x:fieldmodifier="Public" grid.columnspan="2" grid.rowspan="2" xmlns:x="#unknown">
            <splitview.pane>
                <scrollviewer x:name="scrol1" isverticalrailenabled="True">
                    <!--<Grid Background="Gray">-->
                    <stackpanel background="Gray" scrollviewer.verticalscrollmode="Enabled">

                        <border borderthickness="0.4" x:name="border3" borderbrush="White" margin="10,10,0,0" width="280" horizontalalignment="Left" />
                        <textblock x:name="langlist2" text="Language" margin="10,15,0,0" foreground="White" fontsize="13" fontweight="Light" />
                        <listview x:name="langlist" height="Auto" width="Auto" selectionchanged="langlist1_SelectionChanged">
                            <listview.itemtemplate>
                                <datatemplate>
                                    <textblock foreground="White" text="{Binding SortName}" />
                                </datatemplate>
                            </listview.itemtemplate>
                        </listview>

                        <textblock text="Refine" x:name="refine" margin="10,0,0,10" foreground="White" />
                        <border borderthickness="0.4" x:name="border1" borderbrush="White" margin="10,0,0,0" width="200" horizontalalignment="Left" />
                        <textblock text="Sort By :" margin="10,15,0,0" foreground="White" fontsize="13" fontweight="Light" />
                        <listview x:name="sortbylist" selectionchanged="sortbylist_SelectionChanged" scrollviewer.isverticalrailenabled="True" scrollviewer.verticalscrollmode="Enabled" height="Auto" width="Auto">
                            <listview.itemtemplate>
                                <datatemplate>
                                    <textblock foreground="White" x:name="dsasd" text="{Binding SortName}" />
                                </datatemplate>
                            </listview.itemtemplate>
                        </listview>

                        <border borderthickness="0.4" x:name="border2" borderbrush="White" margin="10,10,0,0" width="200" horizontalalignment="Left" />
                        <textblock text="Filter :" margin="10,15,0,0" x:name="refine1" foreground="White" fontsize="13" fontweight="Light" />
                        <listview x:name="filterlist" selectionchanged="filterlist_SelectionChanged" scrollviewer.isverticalrailenabled="True" scrollviewer.verticalscrollmode="Enabled" height="Auto" width="Auto">
                            <listview.itemtemplate>
                                <datatemplate>
                                    <textblock foreground="White" text="{Binding CategoryName}" />
                                </datatemplate>
                            </listview.itemtemplate>
                        </listview>
                    </stackpanel>
                </scrollviewer>
            </splitview.pane>
        </splitview>


This accomplished my work, and all the lists in Splitview are scrolling.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900