protected void ItemChkboxActiveuser_CheckedChanged(object sender, EventArgs e) { ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked; bool checkHeader = true; foreach (GridDataItem dataItem in RgvCampusMaster.MasterTableView.Items) { if ((dataItem.FindControl("ItemChkboxActiveuser") as CheckBox).ClientID == (sender as CheckBox).ClientID) { string lbCampusID = Convert.ToString((dataItem.Cells[0].FindControl("lbCampusID") as Label).Text); string strchk = ""; if ((sender as CheckBox).Checked == true) { strchk = "true"; } else { strchk = "false"; } DataAccessManager.ActiveDeactiveCampusMaster(lbCampusID, strchk); RLChkconstr.Text = string.Empty; } } }