You do have a lot of flexibility here.
If you are willing to store the full data set in memory in the web server (in Session or System.Web.Caching or something) then you absolutely could write your code to retrieve the full set of data on the first call and then only return a page at a time. That model would be quite different from what I show in the 2.1 Handbook, but it would be relatively easy to do.
But I think most people use paging to avoid bringing all the data back from the database, and so that's the approach I show in the 2.1 Handbook.
If you use some of the commercial grids available, I think you can jsut bind a full list of data to them and they will handle all the pagin stuff for you.
I have done this with relatively small lists (100 or less records), and just fill a collection, and my grid handles the paging, I just click the Enable Paging option, simple as that.
I use telerik controls for web stuff, and infragistics for winforms. Not sure about infragistics, but telerik seems to hanlde the paging itself.
Oh I see, you want CslaDataSource to keep a copy of the complete
collection and return only a subset of that collection on demand?
That would be difficult (though not impossible) with the CSLA
.NET data portal model. You’d still have to do some extra work in your
business collection class, because this scheme would require that the
collection be created via DP_Fetch(), but that object would never be publicly
exposed. Rather, there’d need to be some new mechanism by which
CslaDataSource could create new instances of your collection class, and
indicate that you should load that new instance with just one page of data from
the existing complete list.
Again, in the web model the typical idea behind paging is to
avoid loading all the data from the database in one shot – which this
would require – so I’m not convinced that it is a good idea, or one
that most people would even consider using.
Rocky
From: kids_pro
[mailto:cslanet@lhotka.net]
Sent: Sunday, February 04, 2007 7:21 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Can't Paging Support be simplify
Yes, that my point.
Paging is UI responsibility since CslaDataSource is the one component that deal
with UI we should force responsibility upon it.
Copyright (c) Marimer LLC