Skip to content

Problem with Grouped CollectionView on Windows #7634

Closed
@hartez

Description

@hartez

Discussed in #7528

Originally posted by XamerDev May 27, 2022
Hello I need to create grouped collectionView but I'm facing some issues on Windows. On android works well
Code

public class FoodGroup : ObservableCollection<Food>
        {
            public string Name { get; private set; }

            public FoodGroup(string name, ObservableCollection<Food> foods) : base(foods)
            {
                Name = name;
            }
        }
        public ObservableCollection<FoodGroup> Lines { get; private set; } = new ObservableCollection<FoodGroup>();

and when I trying add something to Lines collection:
Lines.Add(new FoodGroup("group1", new ObservableCollection<Food> { }));
I facing this issue:
"MauiApp3.ViewModels.JournalViewModel+FoodGroup" is not of type "MauiApp3.Models.Food" and cannot be used in this generic collection. Arg_ParamName_Name”

Issue appears only on Windows, on android emulator everything is working properly.
Is it something connecting with MAUI itself or it's just my misunderstanding of something?
Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-controls-collectionviewCollectionView, CarouselView, IndicatorViewpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/windowss/triagedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versions/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions