Filtering and paging data in a DataGrid

Along with offering us support for the sorting and filtering of data, the PagedCollectionView has more up its sleeve. It is also the enabler for filtering rows in a DataGrid and, in combination with the DataPager control (a control added with Silverlight 3), it allows us to spread the data over several pages within the DataGrid.

In this recipe, we'll look at how we can filter based on a value specified by the user and we'll page the results based on the number of returned results, if needed.

Getting ready

This recipe builds on the code that was created in the previous recipes. You can continue using your code to follow this recipe. Alternatively, you can use the start solution located in the Chapter04/Datagrid_Filtering_And_Paging_Starter ...

Get Silverlight 4 Data and Services Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.