我想创建朋友列表,但一次只能在gridview中显示3条记录 [英] i want to create friend list but at a time only 3 records can be display in gridview

查看:83
本文介绍了我想创建朋友列表,但一次只能在gridview中显示3条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个朋友列表,但一次只能在GridView中显示3条记录,并且当用户单击显示全部"按钮时,将显示所有记录(例如Facebook和Orkut中的朋友列表).

有人可以帮帮我吗?

在高级中表示感谢.

I would like to create a friend list but at a time only 3 records can be display in GridView and when the user clicks on show all button then all records will be displayed (like friend list in Facebook and Orkut ).

Can any one help me out?

Thanks in advanced.

推荐答案

使用类似这样的查询:
Use a query like this :
select top 3 * from friendslist


最初将分页设置为true,并将页面大小设置为3
Initially set paging to true and page size to 3
(/YourGridViewObject/).AllowPaging=true;
(/YourGridViewObject/).PageSize=3;




在按钮上单击,将allowpaging设置为false,




On button click set allowpaging to false as

(/YourGridViewObject/).AllowPaging=false;


如果使用Linq然后尝试这个
使用索引中的过滤器从数据视图中选择行 [
If you are using Linq then try this
Select rows from dataview using filter in the index[^]
or Dataadapter.Fill method.


这篇关于我想创建朋友列表,但一次只能在gridview中显示3条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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