This Question is Assumed Answered

1 "correct" answer available (5 pts) 15 "helpful" answers available (3 pts)
2 Replies Last post: May 12, 2008 6:47 PM by friedger

Paged View of Records in a RecordGrid

May 12, 2008 3:49 AM

Click to view URPradhan's profile Level 5 URPradhan 71 posts since
Mar 6, 2008
Hi Friends

How to implement the paged view of a RecordGrid ?
Means suppose I have 10,000 records in a RecordSet and I want to show only 100 records per page/view in a RecordGrid and the rest are should be accessible through a CommandButton /Link (do not want to use the default navigation control as it does not give a professional look :( ) ONLY after request from the user to avoid unnecessary data transfer from the server. But to keep the users happy, we can transfer the next page/set of data in background in advance. How to implement this ? Any pointer ?

Current I'm displaying all the records in the RecordGrid which takes lots of initial time.
And I did not found any method of RecordSet to get a sub-set of it (another subset of RecordSet ).
Only RecordSet.select is there which asks for a filter, but there is no such filters can be applied like from records 1-100, 101-200, 201-300, etc ....

But if we can implement the above concept of paged view and background request of data for next page in advance then we can make the users happy :-)
Correct me if I'm wrong.

//Thank you
Click to view carl's profile Curl carl 21 posts since
Oct 17, 2007
1. Re: Paged View of Records in a RecordGrid May 12, 2008 1:47 PM
Are you using CDBC? Some amount of server-side processing will be needed to avoid sending over records.

You can get an effective subset of a RecordSet using a RecordView (a subclass of RecordSet). You can set a RecordFilter on a RecordView that looks at a source RecordSet, and then set RecordGrid to point to that RecordView. (RecordGrid uses RecordView internally, which is why you can also set a RecordFilter on a RecordGrid.)

You could define a RecordFilter that returns true for a given ID and the next 99 records, for example, though this alone doesn't necessarily help with the network overhead. But if the main, server-connected RecordSet then loaded the next probable hundred records in the background, those new records would fail the filter test and not be displayed in the RecordGrid. The net effect would be, in this example, to have 200 local records at a time, of which half were displayed; every jump would have the server send a set purged of the hundred outdated records, keeping the hundred current (previously local but not displayed), and adding the next hundred (hidden).

There are likely other ways to produce the same effect.

On question of navigation appearance, are you using styled controls or the old UI? Do you have an example of how it doesn't meet your requirements or of how you would prefer it to look?
Click to view friedger's profile MVP friedger 87 posts since
Jan 13, 2008
2. Re: Paged View of Records in a RecordGrid May 12, 2008 6:47 PM
in response to: carl

I also vote for an implementation of a PagedView or even a LiveView where the filter changes and triggeres the download of new records when the scrollbar is moved.

Friedger