protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
//GridView1.Rows[e.RowIndex].FindControl("二级指标");
GridViewRow row = GridView1.Rows[e.RowIndex];
int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
string ejzb = ((TextBox)row.FindControl("GridView1")).Text.ToString();
string zygcd = ((TextBox)row.FindControl("主要观测点")).Text.ToString();
string strsql = "Update 评价标准 Set 二级指标=‘" + ejzb + "‘,主要观测点='" + zygcd + "' Where ID=" + ID + "";
Response.Write(ejzb);
BaseClass1.execsql(strsql);
GridView1.EditIndex = -1;
bindgrig();
}
其中的string ejzb = ((TextBox)row.FindControl("GridView1")).Text.ToString();的 ((TextBox)row.FindControl(""))填GridView1显示错误 应该填什么的?
{
//GridView1.Rows[e.RowIndex].FindControl("二级指标");
GridViewRow row = GridView1.Rows[e.RowIndex];
int ID = int.Parse(GridView1.DataKeys[e.RowIndex].Values[0].ToString());
string ejzb = ((TextBox)row.FindControl("GridView1")).Text.ToString();
string zygcd = ((TextBox)row.FindControl("主要观测点")).Text.ToString();
string strsql = "Update 评价标准 Set 二级指标=‘" + ejzb + "‘,主要观测点='" + zygcd + "' Where ID=" + ID + "";
Response.Write(ejzb);
BaseClass1.execsql(strsql);
GridView1.EditIndex = -1;
bindgrig();
}
其中的string ejzb = ((TextBox)row.FindControl("GridView1")).Text.ToString();的 ((TextBox)row.FindControl(""))填GridView1显示错误 应该填什么的?
解决方案 »
- C#,MySql的连接方法
- C#中有一个hashtable是公共的。怎么判断这个是否锁住了?
- SQl2000查询分析器报错问题,求救!!!
- 如何读取richtextbox中的图片和文字
- 最近碰到建行的数字签名验证的问题,不知哪位做过RSA公钥验证签名的呀?
- Enterprise Library 的App.config中连接字符串加密的问题(在线等)
- 协同物流管理平台急招软件开发
- ODBC连接数据库插入、更新时变量声明和自动更新问题
- 如何实现拖放
- [300分]大家帮帮忙,困扰我很久的问题了,关于动态生成控件的问题!!!
- 请教各位,帮我看一下,错误在哪里?
- 如何用querystring接收2个以上的参数
{
gv.EditIndex = e.NewEditIndex;
BindData();
}
protected void gv_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
gv.EditIndex = e.RowIndex;
int id = int.Parse(gv.DataKeys[e.RowIndex].Value.ToString());
string ejzb = ((TextBox)gv.DataKeys[e.RowIndex].FindControl("txt")).Text; gv.EditIndex = -1;
BindData();
}
======
string ejzb = ((TextBox)row.FindControl("TextBox1")).Text.ToString();TextBox1是gridView内模板列内textbox的ID