I have a webpage that displays a very large list of data. Since this was bogging down the browser, I implemented paging (using a PagedDataSource) to display 20 Marbles at a time.
My data model is such that a Bag contains multiple Marbles, and on my repeater I show a little header for the Bag information then all of the Marbles underneath it.
Oversimplified example:
Bag1 some Bag specific data -------------------------------------- MarbleA 328 Some St. USA MarbleB 364 another ave. USA MarbleC 7878 Whatever Way USA Bag2 some Bag specific data -------------------------------------- MarbleD 684 Dummy Dr. USA etc.
The problem is, since my page size is 20, I can cut off a Bag's Marbles on the end of a page. (Imagine MarbleB was the 20th element.) This causes the remaining Marbles to spill over to the top of the next page.
Is there any elegant way to check for this, or am I going to have to implement my own paging and add a "look ahead until the next bag" logic?
Edit: assume c# 2.0, VS2008, SQL 2005