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

Reading number is top 10 articles
delphi工程选项及桌面配置文件(.dof)
实例:在ASP.NET中创建使用全球唯一标识符_.net资料_编程技术
SQL2000系统表的应用_[SQL,Server教程]
Asp.Net中虚拟文件系统的使用_[Asp.Net教程]
解决网爬工具爬取页面信息出现乱码的问题_[Asp.Net教程]
编辑web.config,保证ASP.NET的安全_.net资料_编程技术
C#.net,控制Windows,Messenger和Windows,Live,Messenger_[Asp.Net教程]
轻松掌握Ajax.net系列教程三:使用CascadingDropDown组件_[Asp.Net教程]
应用技巧:用PHP简易实现中文分词_php资料_编程技术
ASP.NET,2.0移动开发入门之使用样式_[Asp.Net教程]
Reading number is top 10 pictures
A man's favorite things12
中国处女图鉴2
10 powerless things in life
The wise woman of chest1
Is said to be a Chinese female artist fame explicit pictures before2
Rendez-vous Sleep with actress, three days to earn 600000
沙漠里的美女
非笑不可:最强爆笑图片精选
Summer is most suitable for young people to travel in China7
The little girl with long hair1
Download software ranking
Tram sex maniac 2 (H) rar bag8
Tram sex maniac 2 (H) rar bag12
WebService在.NET中的实战应用教学视频 → 第2集
天龙八部十二宫服务端
Kung fu panda - the secret of the teacher
Boxer vs Yellow2
卡丁车单机版
美女写真1
Visual C++界面编程技术
C语言教程TXT
delv published in(发表于) 2014/1/24 9:03:40 Edit(编辑)
ASP.NET2.0下含有CheckBox的GridView删除选定记录实例_[Asp.Net教程]

ASP.NET2.0下含有CheckBox的GridView删除选定记录实例_[Asp.Net教程]

ASP.NET2.0下含有CheckBox的GridView删除选定记录实例_[Asp.Net教程]

前台代码 :
DataKeyNames="DB1_1,DB1_2" Height="279px" >



<%# this.GridView1.PageIndex * this.GridView1.PageSize + this.GridView1.Rows.Count + 1%>









Text="删除" >









后台代码:
protected void btnDelete_Click(object sender, EventArgs e)
{
string strDelete = "";
4 for (int i = 0; i < this.GridView1.Rows.Count; i++)
5 {
6 string Label;
7 bool isChecked = ((CheckBox)GridView1.Rows[i].FindControl("chkSelect")).Checked;
8 Label = ((Label)GridView1.Rows[i].FindControl("labXH")).Text;
9 if (isChecked)
10 {
11 strDelete = "DB1_1" + "=" + Label;
12 }
13 }
14 conn.RunSql("Delete from DB1 where " + strDelete
15 this.chkSelectAll.Checked = false;
16 GridViewBind();
17 }
18
19 protected void chkSelectAll_CheckedChanged(object sender, EventArgs e)
20 {
21 //遍历GridView行获取CheckBox属性
22 for (int i = 0; i < this.GridView1.Rows.Count; i++)
23 {
24 ((CheckBox)GridView1.Rows[i].FindControl("chkSelect")).Checked = this.chkSelectAll.Checked;
25 }
26 }

来源:网络







添加到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.