的GridView:如何设置的行数,以显示 [英] GridView: How to set the number of rows to display
本文介绍了的GridView:如何设置的行数,以显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想我的网格视图只显示3行我如何能做到这一点任何想法?
I would like my grid view to display only 3 rows any ideas on how I can achieve this?
感谢
推荐答案
Enable Paging and set the GridView's PageSize
to 3.
的How到:在GridView Web服务器控件启用默认分页
如果你想限制你的GridView只显示3无分页行,你需要使用数据源
只有3条(FE通过SQL - TOP
-Clause或限制
在MySQL或LINQ的取(3)
)。
If you want to restrict your GridView to show only 3 rows without paging, you need to use a DataSource
with only 3 records (f.e. via SQL-TOP
-Clause or Limit
in MySQL or LINQ's Take(3)
).
这篇关于的GridView:如何设置的行数,以显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文