Hello,
I have to fetch millions of records from SQL server and display it on xamgrid. I have read couple of months back Infragistics grid fetchs records from database and display just a page number of rows which is visible to user.
I know this is quite FAQ type question, but I am unable to find the solution. Please point me to existing article, source code or just pseudo code.
Thanks,
Mahesh
Hello Mahesh,
The XamDataPresenter family controls use some virtualization techniques, so pagination is not really needed. Only the records that are currently in view are created and the rest are not - to improve responsiveness and memory usage of the application. When new records come in view, they are created and the ones that come out of view are destroyed.
You can impelement your own pagination, by using DataPresenterCommands and BringIntoView() method, by calculating the DataRecordPresenter's height and setting the grid to the desired height - probably something like this thread
If you would like the lazy load to be performed to get records from the database, you have to implement this yourself.
Hope this helps,
Alex.
Alex,
Thanks for prompt reply. I got an idea now by seeing your reply.
One more question. Which of the following solution u suggest me about this scenario.
Problem:
I have millions of records in Database.
Solutions, I am thinking.
a) background worker thread fetch entire data from Database into local box and store it in xml file or dataset. Then display few records using BringintoView()
b) fetch records from Database as on when user scrolls to next page. That means each time I should hit DB and get records.
or u suggest any other ways Infragistrics provides (for ex: ultradatasource for wingrid) which doesn't hamper performance.