All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ADO.NET快速起步_[Asp.Net教程]
关键词的选择是网络营销走向成功的第一步_谷歌优化_seo学堂
轻松加密ASP.NET,2.0,Web程序配置信息_.net资料_编程技术
XML入门教程-现实生活中的XML_[XML教程]
在ASP.NET,Atlas中调用Web,Service—应用Cache减小服务器开销_[Asp.Net教程]
ASP.NET效率陷阱之——Attributes_[Asp.Net教程]
下一主题的实现_[PHP教程]
ASP.NET利用webclient获取页面源代码的解决方法_[Asp.Net教程]
ASP.NET常用的三十三种实用代码_[Asp.Net教程]
Asp.net的身份验证_[Asp.Net教程]
Reading number is top 10 pictures
30 beautiful school beauty3
Sanya, hainan Haitian party feast promiscuity
西游四格漫画(六)
A man's favorite things9
From China fortress sora aoi3
迷人的靓女
China railway shunting skills competition
The goddess of the single reason1
奇趣的世界记录2
The household of rural style is designed
Download software ranking
Eclipse-CALMSANNY (second edition)
Proficient in JavaScript
Popkart Cracked versions Mobile phone games
Red cliff
虚拟机汉化软件
Sora aoi - one of more PK
中国结婚习俗实录
The Bermuda triangle3
Tram sex maniac 2 (H) rar bag18
Ashlynn Video1
aaa published in(发表于) 2013/12/11 8:29:42 Edit(编辑)
ASP.NET组件DataGrid的分页实用方法_.net资料_编程技术

ASP.NET组件DataGrid的分页实用方法_.net资料_编程技术

ASP.NET组件DataGrid的分页实用方法_.net资料_编程技术-你的首页-uuhomepage.com

  查了网上资料,关于这个DataGrid分页实在是太多太多方法,有些解决方法过于Trick,有些则效率较低,这里提供一个不太麻烦,也效率尚可(通过Session缓存DataSet)的方法:


  拖动DataGrid到WebForms,从DataGrid的属性栏中选择Columns打开DataGrid Properties自定义对话框,选择Paging分页,Allow paging, Page size: 20。


private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if(!this.IsPostBack)
{
sqlDataAdapter1.Fill(dataSet11);
Session["CopyYear"]=dataSet11;
DataGrid1.DataSource = dataSet11.Tables[0].DefaultView;
DataGrid1.DataBind();
}
}
private void DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
DataGrid1.CurrentPageIndex=e.NewPageIndex;
dataSet11=(DataSet1)Session["CopyYear"];
DataGrid1.DataSource = dataSet11.Tables[0].DefaultView;
DataGrid1.DataBind();
}


  在页面上添加上述代码,OK






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.