GridView里已经绑定数据,显示出来了,外部加一个button,想得到GridView行列的值,如下
protected void Button5_Click(object sender, EventArgs e)
{
Response.Write(GridView1.Rows[1].Cells[0].Text);
}
这样写,得到的是空
protected void Button5_Click(object sender, EventArgs e)
{
Response.Write(GridView1.Rows[1].Cells[0].Text);
}
这样写,得到的是空
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(GridView1.HeaderRow.Cells[3].Text.ToString());
}
我打出来的是表头,没有问题啊
http://www.cnblogs.com/insus/articles/2029383.html
http://www.cnblogs.com/insus/archive/2011/10/09/2202301.html
http://www.cnblogs.com/insus/articles/1413740.html
http://www.cnblogs.com/insus/archive/2011/06/30/2094151.html