62,074
社区成员
发帖
与我相关
我的任务
分享
protected void selectBtn_Click(object sender, EventArgs e)
{
string str = "";
//获得被选中的项目
for(int i = 0; i < GridView1.Rows.Count; i++)
{
if (((CheckBox)GridView1.Rows[i].FindControl("RowLevelCheckBox")).Checked)
{
str = str + i + ",";
}
}
Test t = new Test();
string[] arr=str.Split(',');
for (int j = 0; j < arr.Length-1;j++ )
{
int id;
int.TryParse(arr[j], out id);
string st = GridView1.Rows[id].Cells[0].Text; //取得ID
t.DeleteRecoder(st); //调用删除的方法
}
Bind(); //重新绑定数据源
}