List grouping works in Android but not in iOS

JesseLibertyJesseLiberty USInsider, University ✭✭✭

I have the following:

 var sorted = from linkReportItem in linkReportItems
                      orderby linkReportItem.Category
                      group linkReportItem by linkReportItem.Category into categoryGroup
                      select new Grouping<string, LinkReportItem>( categoryGroup.Key, categoryGroup );

I then iterate through it, adding to this collection:

      public ObservableCollection<Grouping<string, LinkReportItem>> LinkedReportItemGrouped { get; set; } =
         new ObservableCollection<Grouping<string, LinkReportItem>>();

Here is the iteration:

                foreach ( Grouping<string, LinkReportItem> item in sorted )
                {
                   LinkedReportItemGrouped.Add( item );
                }

This works fine in Android, but in iOS it crashes saying that "Index 9 is greater than the number of rows 8"

Any ideas why this would be happening in iOS and how I might fix it?

Thanks!!

Best Answer

Answers

Sign In or Register to comment.