开发者

Using pagination techniques with DataGridView

I have a dataGridView and a REST web service that I use to get records from a database - these are formed as objects and bound to the dataGr开发者_JAVA百科idView.

They are not as closely bound to a database as is traditional with SQL Server etc, (bear in mind I can't utilise the full functionality of a dataGridView with all of Microsoft's products as is the usual case with databinding, due to it being a REST web service done in Java etc).

I have also enabled a paging mechanism on my web service to get 100 records at a time e.g.

http://mywebservice/employees/0/100

What I want to do is automatically ping the web service for another 100 records when the user scrolls the scrollbar to the bottom of the dataGridView. It then adds these records to the dataGridView - which now shows 200 records, and so on.

Is there a way to do this reasonably simply? Is my idea sound? One thing I was stuck on was trying to understand a way to know when the user has scrolled to the bottom of the dataGridView .


What you want is basically 'Lazy load with infinite scrolling'. Here is a pretty good article on this:

http://www.eggheadcafe.com/tutorials/aspnet/b8381915-06d9-4538-b4bb-5ac2a8e73f34/implementing-continuous-s.aspx

Plus you might want to check out SlickGrid.
Demo: http://mleibman.github.com/SlickGrid/examples/example6-ajax-loading.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜