开发者

WPF Paged CollectionViewSource

开发者 https://www.devze.com 2022-12-08 22:34 出处:网络
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 limi

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 d开发者_开发百科ata 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?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消