开发者

ASP.NET DataGridView paging with server-sided paging

开发者 https://www.devze.com 2023-01-25 19:20 出处:网络
I am passing the PageNumber and PageSize to a stored procedure, which returns only that page of data. It also returns a record count what the total number of records would be if I returned all of them

I am passing the PageNumber and PageSize to a stored procedure, which returns only that page of data. It also returns a record count what the total number of records would be if I returned all of them at once.

Generally, how do i hook this up to the DataGridView to enable paging?

It seems like the expectation is for the resultset to contain the complete dataset.

Many of the properties that I expect to be able to set, 开发者_开发知识库like RecordCount, appear to be read only.

Could someone give me general pointers?


I created a similar solution once, and adjusted a GridView (not sure if you mean a DataGrid or a GridView) to use server-side paging. The code is too much to post here and since there's no option for attachments here, you can download the code from http://www.raskenlund.com/downloads/GridView.zip


Check out the following article which describes the same thing:

http://www.highoncoding.com/Articles/210_GridView_Custom_Paging.aspx

0

精彩评论

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