protected void LinkButton2_Click(object sender, EventArgs e) //delete { string idstr = ""; for (int i = 0; i < this.GridView1.Rows.Count; i++) { CheckBox chk = (CheckBox)this.GridView1.Rows[i].FindControl("CheckBox1"); if (chk.Checked) { idstr = idstr + this.GridView1.Rows[i].Cells[1].Text + ","; } } string ids = idstr.Substring(0, idstr.Length - 1); MessageBLL.DeleteReceivedMessage(ids); BindGrid(); }