protected void btnDelete_Click(object sender, EventArgs e) { try { for (int i = 0; i < gvMain.Rows.Count; i++) { CheckBox chk = (CheckBox)gvMain.Rows[i].Cells[0].Controls[0]; if (chk.Enabled && chk.Checked) { dsLog.Tables[0].Rows[i].Delete(); } } objLog.Delete(dsLog); totalCount = objLog.GetRowCount(filter); pager.RecordCount = totalCount; if (pageIndex > pager.PageCount) { pageIndex = pager.PageCount; } GridDataBind(); } catch (Exception exp) { JScript.Instance.ShowMessage(this.UpdatePanel1, exp.Message); } }