private void lkbtnDeleteCheck_Click(object sender, EventArgs e) { IList <int> msgIDs = new List <int>(); int num = 0; foreach (GridViewRow row in this.grdStoreMessage.Rows) { CheckBox box = (CheckBox)row.FindControl("checkboxCol"); if (box.Checked) { num++; int item = Convert.ToInt32(this.grdStoreMessage.DataKeys[row.RowIndex].Value, CultureInfo.InvariantCulture); msgIDs.Add(item); } } if (num != 0) { int num3 = StoreMessageBrowser.DeleteStoreMessages(msgIDs); this.BindSearch(); this.ShowMsg(string.Format(CultureInfo.InvariantCulture, "成功删除{0}条留言", new object[] { num3 }), true); } else { this.ShowMsg("请先选择需要删除的留言", false); } }