From the course: .NET MAUI: Beyond the Basics

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Collapsing groups with the CollectionView

Collapsing groups with the CollectionView - .NET MAUI Tutorial

From the course: .NET MAUI: Beyond the Basics

Collapsing groups with the CollectionView

- [Instructor] The Collection View supports creating groupings of data as part of the control with the ability to create a header, footer, or both. This is with the caveat that the data has to be shaped in a very particular way to support it, that is a list that also has the required properties on it to support the header and footer. In the starting state of the code we have, for this particular video, we have such a collection set up with groupings as we can see on the screen. A common feature in this type of design is to be able to collapse and expand as we click on the header. This functionality is not supported by the Collection View out of the box. We are going to look at one way to support it by maintaining two lists in the view model. One is a list of what is displayed that is an observable collection, so we can make changes to be reflected on the UI, and another list to track the original list pulled from the…

Contents