DataGridView的用法

2008-08-26 13:28:23.0     浏览:2698     来源:中国IT实验室
关键词:  DataGridView     用法  

//真实的删除操作

  public void btnRealDel_Click(object sender, EventArgs e)

  ...{

  int count = 0;

  for (int i = 0; i <this.gvSupplier.Rows.Count; i++)

  ...{

  CheckBox myCb = (CheckBox)(this.gvSupplier.Rows[i].Cells[10].FindControl( "cbSelect "));

  if (myCb.Checked)

  ...{

  count++;

  HyperLink hl = (HyperLink)(this.gvSupplier.Rows[i].Cells[7].Controls[0]);

  int suppId = int.Parse(hl.Text.ToString());

  string sqlString = "delete from Supplier where SuppId= " + suppId;

  this.ExecuteSql(sqlString);

  }

  }

  if (count >0)

  ...{

  this.Alert( "你成功删除了 " + count + "条数据 ", this.Page);

  this.BindGvSupplier();

  }

  }

[上一页]   [第1页]   [第2页]   [第3页]   [第4页]