Group multiple objects into one in a collectionView

Stefano M 91 Reputation points
2021-03-28T19:59:25.197+00:00

I have a collectionView with some elements inside it, which have a DateTime property. The graphic of each element is defined within the DataTemplate, but I would like that when there are multiple elements with the exact same DateTime property, they would be 'grouped' into a single object in the graphic

My collectionview already has groups, so what could be the right solution?
NOW:
Now
LATER:
Later

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
4,818 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. 2021-03-30T09:44:17.067+00:00

    Hello,

    Welcome to Microsoft Q&A!

    • Group your list according DateTime , and put them together ,then you'll get a grouped list which contains the same DateTime items , refer to the code .
    • Set Bindable Layouts(e.g StackLayout) as DataTemplate of CollecitonView .
    • Customize DataTemplate inside Bindable Layouts .
    • Create correct binding on every control and then populate the data .

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments