Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WPF Gap: CollectionViewSource doesn't support all WPF scenarios #4307

Open
michael-hawker opened this issue Feb 23, 2021 · 9 comments
Open
Labels
feature proposal New feature proposal team-Controls Issue for the Controls team wct wpf-vs-winui-mismatch

Comments

@michael-hawker
Copy link
Collaborator

michael-hawker commented Feb 23, 2021

Proposal: CollectionViewSource doesn't support all WPF scenarios

Summary

The CollectionViewSource in UWP is inferior to the one in WPF doc here.

The WPF one supports live filtering, grouping, and sorting all out of the box. The UWP one does not. ☹

For instance, this DataGrid grouping scenario is not easily achievable in UWP.

Rationale

Creating sorted, grouped, and/or filtered lists in UWP is a pain, especially trying to combine any combination of these. The CollectionViewSource is supposed to be this abstraction above the data layer itself. UWP/WinUI should provide a first/best-in-class solution to these common scenarios and match or improve upon the WPF APIs.

Scope

Capability Priority
Allow (Live) Grouping Must
Allow (Live) Sorting Must
Allow (Live) Filtering Must
Allow any combination of the three to work in tandum together Must
Able to configure CVS in XAML Should

Related to #2685 and #33

@michael-hawker michael-hawker added the feature proposal New feature proposal label Feb 23, 2021
@ghost ghost added the needs-triage Issue needs to be triaged by the area owners label Feb 23, 2021
@michael-hawker
Copy link
Collaborator Author

We have the AdvancedCollectionView in the toolkit, but it doesn't support all the scenarios, and is already getting complex. It'd be great to just see this be within the platform and have the WPF version at least ported as a starting point.

@ranjeshj ranjeshj added team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Feb 24, 2021
@omikhailov
Copy link

In general, it would be good to have as flexible version of CollectionViewSource as WPF's one, but it seems like you are focusing on not the most demanded things. CollectionViewSource in WPF is intended for in-memory data processing. But today most common data source is IQueryable from WebAPI or Entity Framework and it is not common to load whole table in the application to sort / group / filter it on the client side. Sometimes instead of EF folk uses Dapper where IQueryable is not available, but this is another story and it does not work well with CollectionViewSource too. It would be much better if WinUI team would focus more on modern online use cases rather than compatibility.

@LadderLogic
Copy link

@michael-hawker is this feature on any projected road-maps
?

@michael-hawker
Copy link
Collaborator Author

@LadderLogic I own the Windows Community Toolkit, so I don't know if there's plans on the WinUI side to work on this in the near future or not. I don't think @anawishnoff is the correct owner for this anymore, @gabbybilka who should own this now?

We have an AdvancedCollectionView in the Toolkit, but it doesn't cover all the scenarios currently (thus why I opened this issue for tracking with the platform).

I'm not too sure where our gaps lie currently as we have some other helpers we've developed since for grouping scenarios. We want to improve our samples more later this year with our next release, so we'll have a better understanding then. I know @Sergio0694 has been making some examples of these scenarios for the MVVM Toolkit Samples, but not sure if they're merged into main yet or just in a PR.

@LadderLogic
Copy link

@LadderLogic I own the Windows Community Toolkit, so I don't know if there's plans on the WinUI side to work on this in the near future or not. I don't think @anawishnoff is the correct owner for this anymore, @gabbybilka who should own this now?

We have an AdvancedCollectionView in the Toolkit, but it doesn't cover all the scenarios currently (thus why I opened this issue for tracking with the platform).

I'm not too sure where our gaps lie currently as we have some other helpers we've developed since for grouping scenarios. We want to improve our samples more later this year with our next release, so we'll have a better understanding then. I know @Sergio0694 has been making some examples of these scenarios for the MVVM Toolkit Samples, but not sure if they're merged into main yet or just in a PR.

@michael-hawker Thank you! The AdvancedCollectionView works nicely for sort descriptors. Haven't found an example for grouping

@kateryna-novak
Copy link

@michael-hawker, @Sergio0694, could you please provide a sample of how to use grouping in the AdvancedCollectionView? As I understand from the documentation, AdvancedCollectionView supports grouping. However, I could not find any example of how to use it.

@michael-hawker
Copy link
Collaborator Author

@kateryna-novak if you just need grouping, there's the ObservableGroup option as well as shown in the MVVM Toolkit app Collection sample: https://aka.ms/mvvmtoolkit/app

@kateryna-novak
Copy link

@kateryna-novak if you just need grouping, there's the ObservableGroup option as well as shown in the MVVM Toolkit app Collection sample: https://aka.ms/mvvmtoolkit/app

@michael-hawker I need filtering and grouping. That's why I'm asking.

@ttustonic
Copy link

Is it even possible to have a multi level grouping in ListView, DataGrid etc? There's no example anywhere.
Or is it also not 'modern online use case' ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature proposal New feature proposal team-Controls Issue for the Controls team wct wpf-vs-winui-mismatch
Projects
None yet
Development

No branches or pull requests

7 participants