protected void btDelete_Click(object sender, EventArgs e) { string[] ID = new string[GridView1.Rows.Count]; int m = 0; //查找GridView中已选数据项 for (int i = 0; i < GridView1.Rows.Count; i++) { if (((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))).Checked) { //获取已选项的主键值 string id = Convert.ToString(this.GridView1.DataKeys[i]["bih"]); ID[m] = id; m++; } } //GridView1Bind(); } }
protected void btDelete_Click(object sender, EventArgs e)
{
string[] ID = new string[GridView1.Rows.Count];
int m = 0;
//查找GridView中已选数据项
for (int i = 0; i < GridView1.Rows.Count; i++)
{
if (((CheckBox)(GridView1.Rows[i].FindControl("CheckBox1"))).Checked)
{
//获取已选项的主键值
string id = Convert.ToString(this.GridView1.DataKeys[i]["bih"]);
ID[m] = id;
m++;
}
}
//GridView1Bind();
}
}