我想要實現的功能:
1.黨我選中checkbox,當前這條記錄的信息顯示到textbox上(根據PRInfoBind()),當前這條紀錄的背景顔色為紅色!
private void PRInfoBind()
{
int recordCount = 0;
string thisPR_ID = "";
string thisMat_ID = "";
string thisSupplier = "";
string thisBuyer = "";
for (int i = 0; i < this.GridView_PR.Rows.Count; i++)
{
CheckBox cb_Check = (CheckBox)this.GridView_PR.Rows[i].FindControl("cb_Check");
if (cb_Check.Checked)
{
this.GridView_PR.Rows[i].BackColor = System.Drawing.Color.Yellow; thisPR_ID = this.GridView_PR.Rows[i].Cells[2].Text.ToString().Trim();
thisMat_ID = this.GridView_PR.Rows[i].Cells[3].Text.ToString().Trim();
thisSupplier = ((Label)this.GridView_PR.Rows[i].FindControl("Label1")).Text.ToString().Trim();
string strSql = "select distinct buyer from tbprxz where pr_id='" + thisPR_ID + "' and mat_id='" + thisMat_ID + "'";
thisBuyer = dl.ExcuteScalar(strSql); this.DDL_PR_ID.SelectedValue = thisPR_ID.ToString();
this.DDL_Supplier.Items.Insert(0, thisSupplier.ToString());
this.DDL_Buyer.SelectedValue = thisBuyer.ToString();
}
}
}2.當前取消,當前textbox上的信息清空,當前這條紀錄的背景顔色還原!請問大家應該怎麽做?以下就是把上面的問題分開化,但是還是有很多問題
http://topic.csdn.net/u/20080515/11/68a0780a-e5b5-4bba-81c0-d2222b4002de.html
http://topic.csdn.net/u/20080515/09/1698861e-96a9-440b-8ae7-2bea1e43f208.html
1.黨我選中checkbox,當前這條記錄的信息顯示到textbox上(根據PRInfoBind()),當前這條紀錄的背景顔色為紅色!
private void PRInfoBind()
{
int recordCount = 0;
string thisPR_ID = "";
string thisMat_ID = "";
string thisSupplier = "";
string thisBuyer = "";
for (int i = 0; i < this.GridView_PR.Rows.Count; i++)
{
CheckBox cb_Check = (CheckBox)this.GridView_PR.Rows[i].FindControl("cb_Check");
if (cb_Check.Checked)
{
this.GridView_PR.Rows[i].BackColor = System.Drawing.Color.Yellow; thisPR_ID = this.GridView_PR.Rows[i].Cells[2].Text.ToString().Trim();
thisMat_ID = this.GridView_PR.Rows[i].Cells[3].Text.ToString().Trim();
thisSupplier = ((Label)this.GridView_PR.Rows[i].FindControl("Label1")).Text.ToString().Trim();
string strSql = "select distinct buyer from tbprxz where pr_id='" + thisPR_ID + "' and mat_id='" + thisMat_ID + "'";
thisBuyer = dl.ExcuteScalar(strSql); this.DDL_PR_ID.SelectedValue = thisPR_ID.ToString();
this.DDL_Supplier.Items.Insert(0, thisSupplier.ToString());
this.DDL_Buyer.SelectedValue = thisBuyer.ToString();
}
}
}2.當前取消,當前textbox上的信息清空,當前這條紀錄的背景顔色還原!請問大家應該怎麽做?以下就是把上面的問題分開化,但是還是有很多問題
http://topic.csdn.net/u/20080515/11/68a0780a-e5b5-4bba-81c0-d2222b4002de.html
http://topic.csdn.net/u/20080515/09/1698861e-96a9-440b-8ae7-2bea1e43f208.html
解决方案 »
- 这里人多,200分求助win2003下安装证书服务出现找不到网络路径的问题
- DataSet中的数据表发生冲突了~ ,谁能说说是什么原因吗?高分相送
- 怪问题:用response.redirect("a.aspx?name="+username),这个username只能传2个中文字,3个中文字就出现乱码?
- wap网站中如何打开一个空白页
- 前台获取后台变量的问题请教
- 存储过程 问题???
- URL正则表达式问题,当为http://www.aa.cn//aa.aspx应提示出错,因为后面的//是非法的
- 这个如何实现??
- 再请教
- window.open
- 谁能给个 Microsoft Visual Studio .NET 2005 或2008 的下载地址,我下了一个2008装不上
- 密码都加密了,那如果用户要找回密码的话,怎么办?
<head runat="server">
<title>无标题页</title>
<script>
function changecolor(chk)
{
if(chk.checked==true)chk.parentElement.parentElement.style.backgroundColor='red';
else chk.parentElement.parentElement.style.backgroundColor='white';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width: 100px">
<input name="ck" type="checkbox" onclick="changecolor(this)" /></td>
<td style="width: 100px">
呵呵</td>
</tr>
<tr>
<td style="width: 100px">
<input name="ck" type="checkbox" onclick="changecolor(this)" /></td>
<td style="width: 100px">
哈哈</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<head runat="server">
<title>无标题页</title>
<script>
function changecolor(chk)
{
if(chk.checked==true)
{
chk.parentElement.parentElement.style.backgroundColor='red';
}
else {
chk.parentElement.parentElement.getElementsByTagName('input')[1].value='';
chk.parentElement.parentElement.style.backgroundColor='white';
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width: 100px">
<input name="ck" type="checkbox" onclick="changecolor(this)" /></td>
<td style="width: 100px">
<input id="Text1" type="text" /></td>
</tr>
<tr>
<td style="width: 100px">
<input name="ck" type="checkbox" onclick="changecolor(this)" /></td>
<td style="width: 100px">
<input id="Text2" type="text" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>清空用这个饿