如何获得GRID VIEW上的值 C#
的有关信息介绍如下:GridView1.Rows[0].Cells[0] 表示第0行第0列的值 GridView1在指纯槐很多事件里面都可以利用这一个方式获得相应的值假如我要获取 点击行的数据 就可以在GridView1 的RowCommand事件里面这样裤冲写 string value = this.GridView1.Rows[Convert.ToInt32(e.CommandArgument)].Cells[0].Text;如果在其他方法里面获得GridView1 的数据 可以巧用这个方式 int i=0; foreach (GridViewRowCollection row in GridView1.Rows) { for (int cellIndex = 0; cellIndex < row[i].Cells.Count; cellIndex++) { string value = row[i].Cells[cellIndex].Text; } i++; }都用for循环唯友 或 其他循环都可以 看自己喜欢了只是提供个思路了 很多 控件都可以巧用他们的属性 这个不错的选择 GridView1.FindControl("在GridView1里面的控件id名称"); FindControl()是个非常好用的方法