首页 新闻 会员 周边 捐助

高分求答案!!!

0
悬赏园豆:20 [已解决问题] 解决于 2008-05-10 01:18
<P>&nbsp;</P> <P><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">protected</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;Button1_Click(</SPAN><SPAN style="COLOR: #0000ff">object</SPAN><SPAN style="COLOR: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_65_1306_Open_Image onclick="this.style.display='none'; document.getElementById('Codehighlighter1_65_1306_Open_Text').style.display='none'; document.getElementById('Codehighlighter1_65_1306_Closed_Image').style.display='inline'; document.getElementById('Codehighlighter1_65_1306_Closed_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_65_1306_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; document.getElementById('Codehighlighter1_65_1306_Closed_Text').style.display='none'; document.getElementById('Codehighlighter1_65_1306_Open_Image').style.display='inline'; document.getElementById('Codehighlighter1_65_1306_Open_Text').style.display='inline';" alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_65_1306_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG alt="" src="http://www.cnblogs.com/Images/dot.gif"></SPAN><SPAN id=Codehighlighter1_65_1306_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">string</SPAN><SPAN style="COLOR: #000000">&nbsp;selectedKeys&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #800000">""</SPAN><SPAN style="COLOR: #000000">;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">保存所有选中的记录的主键</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #008000"><IMG alt="" src="http://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">for</SPAN><SPAN style="COLOR: #000000">&nbsp;(</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN s
问题补充: http://www.cnblogs.com/barney/archive/2008/04/18/1159130.html 问题在这里 这里发不了图片!!
barney的主页 barney | 初学一级 | 园豆:0
提问于:2008-04-18 08:31
< >
分享
最佳答案
0
if (cb.Checked)这里肯定都是false, 跟踪一下下面两句 if (row.RowType == DataControlRowType.DataRow) 8 { 9 //检查是否选中,假设CheckBox的ID为Checkbox1,且在GVDealNow的第一列中 10 CheckBox cb = (CheckBox)row.Cells[9].FindControl("CBsig"); 这里 GVDealNow.DataKeys[row.RowIndex].DatakeysName.tostring();
AndyFish | 小虾三级 |园豆:1575 | 2008-04-18 08:33
其他回答(5)
0
你是不是删除之后没有对GVDealNow进行绑定数据呀!所以才没有效果出来!
侯垒 | 园豆:3435 (老鸟四级) | 2008-04-18 09:21
0
我以前遇见过像你一样的问题,解决方法就是把绑定GVDealNow的方法写在 if (!IsPostBack) { BindList();//绑定GVDealNow的方法 } 里面。 如果程序没有问题的话,那么问题就应该在这里了,应为你每次点击按钮时就刷新页面,导致CheckBox.Check=false
love .net FrameWork | 园豆:175 (初学一级) | 2008-04-18 09:31
0
这种一般用html控件就好了~~
沙加 | 园豆:3680 (老鸟四级) | 2008-04-18 10:42
0
嗯 注意回发时候的绑定,如3楼 专研.NET 所说的 写在(!IsPostBack) 不过还是觉得用html来做更简便,太依赖服务器控件反而复杂了
wsky | 园豆:558 (小虾三级) | 2008-04-19 15:54
0
你blogs里我看了下。
Bēniaǒ | 园豆:692 (小虾三级) | 2008-04-20 01:41
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册