WPF Paged CollectionViewSource

天涯浪子 提交于 2019-12-11 15:45:35

问题


I have a WPF ListBox that I would like to add pagination to as it starts getting slow with a bunch of items. My problem is that I use the Grouping, Sorting, and Filtering. That means if I were to limit the data with the LINQ Skip() and Take() methods or using something like a paginated ObservableCollection the grouping and sorting would be wrong because it would only be applied to the first page of data. Filtering would be even worse because it would just filter the data displayed in the current display which would mean you would have to be on the page that it would show up on to be able to search for it.

I'm not too keen on the idea of rewriting all of that logic. I see Silverlight 3 is getting a PagedCollectionView (but as far as I can tell WPF in .NET 4 is not getting it). Has anyone implemented something like this before or have any ideas on how I should solve this?


回答1:


Check out a simple Paginated ObservableCollection I have implemented - works for Silverlight as well as WPF

http://jobijoy.blogspot.com/2008/12/paginated-observablecollection.html



来源:https://stackoverflow.com/questions/1603605/wpf-paged-collectionviewsource

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!