ASP.NET中如何获取gridview 双击某一行对应的值 200
1个回答
展开全部
//获取id的值
//int id = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text);
//将id的属性该为Readonly
int id = Convert.ToInt32(GridView1.Rows[e.RowIndex].Cells[0].Text);
//获取GrideView中TextBox1的名字根据id的下标
string des = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox1")).Text;
//string des = (TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0].Text;
//int id = Convert.ToInt32(((TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0]).Text);
//将id的属性该为Readonly
int id = Convert.ToInt32(GridView1.Rows[e.RowIndex].Cells[0].Text);
//获取GrideView中TextBox1的名字根据id的下标
string des = ((TextBox)GridView1.Rows[e.RowIndex].Cells[1].FindControl("TextBox1")).Text;
//string des = (TextBox)GridView1.Rows[e.RowIndex].Cells[1].Controls[0].Text;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询