WPF Application (PagedCollectionView)

Nov 11, 2009 at 8:15 AM

I want to do a lot of things like sorting, paging, grouping and filtering on the WPF Datagrid.

As I already know, paging could be done using LINQ, but firstly, I need to get the total number of records retrieved from the database,

and then page the records in another ObservableCollection class, bind to the WPF Datagrid so that it can display only those paged records.

Sorting, Grouping and Filtering also can be done using CollectionView class.

The problem is, how can I do to sort a paged DataGrid ? Let says I have 100 records, 20 per page, total 5 pages

after binding 20 records to the Datagrid, I can only sort those 20 records ONLY when I clicking the header button of DataGrid ...

What I want to do is when I click on the header button of the DataGrid, I can sort the total 100 records again and then get only 20 out of them, display it.

Does anyone can give me a hand and tell me how can I achieve this ?

By the way, I know PagedCollectionView is available on Silverlight 3 but absent in WPF Application, can I use this function on WPF Application ?


Thanks for reply !!!

Jul 1, 2010 at 2:17 PM
(Eight months of silence later..) I would like to know this aswell. When will the WPF DataGrid have an equivalent of "PagedCollectionView" ?
Sep 25, 2010 at 4:44 PM

Does anyone know if a PagedCollectionView class is planned to be added to WPF? I.e. will the Silverlight class be ported to WPF at some point? This seems like a glaring omission from WPF.

Also it would be great if a VirtualizedWrapPanel were added.

Nov 2, 2010 at 3:18 PM

There is an implementation in the Silverlight Toolkit: http://www.koders.com/csharp/fidE23B98B81F3358F85B5DE7B1FBD54B4324D3BB08.aspx?s=collectionviewgrouproot#L123

Maybe this will help you

Nov 2, 2010 at 3:42 PM

Thanks for the post. I'm still hoping that someone from Microsoft will reply and explain why this functionality hasn't already been ported to WPF. It seems like a glaring omission and I would have expected it to be in .NET 4.0.

Nov 3, 2010 at 1:54 PM

Hey Microsoft DataGrid without paging property is useless.

Nov 3, 2010 at 3:40 PM

Useless to you, maybe.  I have no use for paging in my app.  I'd rather see them fix other problems with DataGrid, like inability to use databinding for header text and general performance.