选中checkbox in gridview,如何让itemfield下面的所有items只读 ???什么意思?选中txtCheckOK让Description/Comments列里面的TextBox都只读? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 GridView1_RowDataBound 在行里找到你的 checkbox 给 把 itemindex 传给 前台用Jquery框架写的事件具体事件自己写 。(如果不想用Jquery 也可以直接使用javascript的Dom对象操作执行) <asp:CheckBox ID="txtCheckOK" />在代码中添加事件.<asp:CheckBox ID="txtCheckOK" OnCheckedChanged="txtCheckOK_CheckedChanged" AutoPostBack="True"/> protected void txtCheckOK_CheckedChanged(object sender, EventArgs e) { for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox chk = (CheckBox)GridView1.Rows[i].FindControl("txtCheckOK"); TextBox txt = (TextBox)GridView1.Rows[i].FindControl("txtMohm"); if (chk.Checked) txt.Enabled = false; else txt.Enabled = true; } } 载入xml文件配置信息 用了backgroundWorker之后 timer不管用了 C#填写身份证号码自动生成身份证地址 控件的缺省值无法传递到DataSet中 一个验证数据库字段的代码 关于将文字转换成声音问题 今天搜点资料, 结果搜出这篇文章来, 好玩. 关于.NET 2005 的安装问题 关于c#里char参数的问题!!!! webform如何获得系统日期?? reportviewer控件与printDialog控件怎么样能绑定使用? datagridvie当选中行时总是在行头现实一个箭头,怎么去掉箭头啊?
具体事件自己写 。(如果不想用Jquery 也可以直接使用javascript的Dom对象操作执行)
for (int i = 0; i < GridView1.Rows.Count; i++) {
CheckBox chk = (CheckBox)GridView1.Rows[i].FindControl("txtCheckOK");
TextBox txt = (TextBox)GridView1.Rows[i].FindControl("txtMohm");
if (chk.Checked)
txt.Enabled = false;
else
txt.Enabled = true;
}
}