ComponentOne Data Source for Entity Framework
Programming Guide / Using ClientView in Code / Server-Side Paging Views
In This Topic
    Server-Side Paging Views
    In This Topic

    The other server-side operation, paging, is specified with the Paging method returning PagingView, a class derived from ClientView:

    PagingView<Product> productsPaged = products.Paging(p => p.ProductName, 20);

    A paging view contains a segment (page) of data at any given time. To create a paging view, you need to specify the page size (20 in the example above) and a key selector by which to sort, because paging can only be done over sorted data.

    Since a paging view is a ClientView, it supports the two fundamental features of client views: it is cache-aware and live. The performance-enhancing cache-awareness of a paging view allows it to avoid round-trips to the server when a page is requested repeatedly. And since a paging view is live (as any ClientView), it reflects changes that you make to the data on the client. For example, if you delete an entity that is currently in a paging view, it will automatically adjust itself to the changed data, including, if needed, fetching some entities from the server to occupy vacant places on the page.