如何取的gridview中i行的值
gridview模版列添加按钮
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "aa ")
{string a=GridView1.Rows[i].cell[0] }
如何得到i的值,无法用[e.RowIndex]取得行
------解决方案-------------------- protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
for (int i = 0; i < GridView1.Rows.Count; i++)
{
string a= GridView1.Rows[i].Cells[2].Text;
}
}
------解决方案--------------------DataRowView row = gvSomething.Rows[i].DataItem as DataRowView;
string s = row[ "Columnname "].ToString();