这个东西还是有用处,为了怕以后忘记,我记录在此
首先:
GridView1.DataSource = Addcolumn.AllInfo();
GridView1.DataKeyNames = new string[] { "id" };//注意
GridView1.DataBind();
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
Response.Write(GridView1.DataKeys[e.NewEditIndex].Value);//注意
this.Panel_Manager.Visible = false;
this.pl_Add.Visible = true;
this.Button2.Visible = false;
this.Button3.Visible = true;
}
当然获取有很多种方法。我觉得这一种最简单;