gridvew使用技巧2

GridVew1_RowDataBind
GridView1.DataKeys[e.Row.RowIndex].Values[5].ToString();
                    foreach (GridViewRow t in GridView2.Rows)
                    {
                        if (((CheckBox)t.FindControl("CheckBox1")).Checked)
                        {
                            ID = GridView2.DataKeys[t.RowIndex].Values[0].ToString();
                            //Num = Int32.Parse(GridView2.DataKeys[t.RowIndex].Values[4].ToString());
                            Num = Int32.Parse(((TextBox)(t.FindControl("tbNum"))).Text);

                            DubtVerificationAppDetailModify(ID, Num, this.lblMainID.Text);
                        }
                    }
原文地址:https://www.cnblogs.com/kedarui/p/3929815.html