Up Display code samples
DevForce Resource Center » Samples » Display code samples » Code sample: Use the EntityQueryPager (WPF)

Code sample: Use the EntityQueryPager (WPF)

Last modified on September 27, 2012 16:56

This sample illustrates how to use the DevForce EntityQueryPager to provide either synchronous or asynchronous paging in a grid control.


Problem

You need to provide a paging capabilities for the results of an EntityQuery.  You require paging since the total number of items returned by the query may be large, and the application user will rarely want to see all results.

Solution

The sample application shows how to use the EntityQueryPager both synchronously and asynchronously.  It also shows how to provide different queries and sort criteria to the pager.

The EntityQueryPager implements many of the members found in the IPagedCollectionView interface, but is not itself a collection or a view.  Think of it instead as the engine for a view which can be used in both Silverlight and WinClient applications.

The application shows the basics of how to page with the EntityQueryPager and how to obtain results.  The sample contains two different windows:  one showing use of the EntityQueryPager with asychronous calls, and one showing synchronous calls.  As you'll notice when looking at the sample, the code is almost identical between the two, except for the "MoveTo" method names and when page results are processed.

entityquerypagesample.JPG

Created by DevForce on October 07, 2011 17:22

This wiki is licensed under a Creative Commons 2.0 license. XWiki Enterprise 3.2 - Documentation. Copyright © 2020 IdeaBlade