0

Currently I'm able to perform grouping using a CollectionViewSource instance that is being binded to a GridView ItemSource. All is working as aspected but I need to add Incremental Loading Support, and I managed to do this in other context using IncrementalLoadingCollection, but I'm not sure if this can be done together without making any UI tweaks.

Currently my code is looking like this :

<GridView
                    x:Name="test"
                          Margin="18,20,0,0"
                          Grid.Row="3"
                          Loaded="All_GridView_Loaded"
                          SelectionMode="Single"
                          ScrollViewer.VerticalScrollBarVisibility="Hidden"
                          HorizontalAlignment="Stretch">
                    <GridView.GroupStyle>
                        <GroupStyle>
                            <GroupStyle.HeaderTemplate>
                                <DataTemplate x:DataType="someType">
                                    <TextBlock Text="{Binding Key}"/>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                        </GroupStyle>
                    </GridView.GroupStyle>
                    <GridView.ItemTemplate>
                        <DataTemplate x:DataType="someType" x:DefaultBindMode="OneWay">


                           .........
                  </DataTemplate>
                    </GridView.ItemTemplate>
                </GridView>

And the code behind for binding :

 var cvs = new CollectionViewSource { IsSourceGrouped = true };
     cvs.Source = some list ....;

     gridView.ItemsSource = cvs.View;
2
  • Why does this have tags other than uwp? Isn't Incrementalloadingcollection unique to uwp?
    – Andy
    Commented Jun 21, 2019 at 18:55
  • @Andy maybe there are other ways of doing it, yes incrementalloadingcollection is uwp specific, but its not mandatory for me, I just try to find out a solution Commented Jun 21, 2019 at 18:58

1 Answer 1

1

Try use MVVM Helpers library by James Montemagno, it has Grouping and ObservableRangeCollection of which you asked for. To see a quick demo watch his video. Or browse on Project github

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.