GridView中的自定义分页 [英] Custom paging in gridview

查看:91
本文介绍了GridView中的自定义分页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我的GridView通过数据集绑定.它包含超过15000条记录.我的一页包含30条记录.我也使用了gridview的编辑功能.因此,当我编辑任何一条记录时,整个网格都将被所有15000条记录绑定.这非常耗时.

所以我只想绑定特定页面中包含的记录数,而不是整个网格.

请给我解决此类到gridview的分页功能的解决方案.

谢谢.
Sonal Patel

Hello Friends,

my gridview bind through dataset. It contains more than 15000 records.my one page contains 30 records. Also i have used editing functionality of gridview. So when i edit any one record, whole grid bind by all 15000 records.its very time consuming.

SO i want to bind only the number of records contain in particular page, not whole grid.

Please give me solution for this type of features of paging to gridview.

Thank you.
Sonal Patel

推荐答案



在这里我说的是我在项目中的实现,它处理了很多DB

首先,我获取1-15条记录,这些记录显示在页面中

之后,获取接下来的15条记录.之后,如果用户单击下一步",则仅从DB中获取接下来的15条记录

如果您使用这种方式,则可以提高您的应用效率.

在这里,我只在单页中显示记录

而且我使用了一个会话变量来保存最后的记录ID.

通过使用该ID,我们必须通过编写以下代码来检索接下来的15条记录.

Hi,

Here I''m saying my implementation in project which are deals lot of DB

first I fetch 1-15 records and those are shown in page

After that fetch next 15 records .After that if user clicks next then only fetch next 15 records from DB

If you use this way it can increase your app efficiency.

Here I show records in single page only

And I used one session variable which holds last record id .

By using that id we''ve to retrieve next 15 records by writing following code.

select * top(20) from Tablename where id>@id;



希望您能理解我说的话

最好的



I hope you''ll understood What I said

All the Best


这篇关于GridView中的自定义分页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆