protected void btnConfig_Click(object sender, EventArgs e)
{
        foreach (GridViewRow row in GridViewInfo.Rows)
        {
            CheckBox dirCheckBox = (CheckBox)row.FindControl("DirCheak");
            if (dirCheckBox != null)
            {
                if (dirCheckBox.Checked == true)
                {
                    myBFUser.DeleteFlatInfo(int.Parse(GridViewInfo.DataKeys[row.RowIndex].Value.ToString()));
                }
            }
        }
        BindGridView();
}

同时还要设置GridView的DataKeyNames属性(绑定数据库字段ID)

相关文章:

  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-09
  • 2022-12-23
  • 2022-02-04
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
相关资源
相似解决方案