有错。请查看http://photo.163.com/photo/luck0790/#m=2&ai=197694854&pi=5836103446&p=1 
e.Row.RowIndex试过了不行

解决方案 »

  1.   

    不是这样写的
     foreach (GridViewRow row in this.GridView1.Rows)
    {
         string DefiID = ((Label)row.FindControl("DefiID_Label")).Text;

    你这样试试呢
      

  2.   

            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                Response.Write(GridView1.DataKeys[i].Value.ToString());
            }
      

  3.   


    for (int i = 0; i < GridView1.Rows.Count; i++)
    {
        Label lblID = (Label)GridView1.Rows[i].Cells[0].FindControl("lblID");
        if (lblID != null)
        {
            string strID = lblID.Text;
        }
    }