定义了DataKeyNames,在后台调用相应的值
Row_Editing事件中,string strID = this.GridView1.DataKeys[e.NewEditIndex]["id"].ToString();
Row_Deleteing事件中,string strID = this.GridView1.DataKeys[e.RowIndex]["id"].ToString();
GridView1_RowCommand事件中,string strID = this.GridView1.DataKeys[Convert.ToInt32(e.CommandArgument.ToString().Trim())].Value.ToString();
总结常用