protected void setChecked(int recordId) { DataTable dataTable = ConferenceManage.QueryApplyEquipment(recordId); if (dataTable.Rows.Count > 0) { for (int i = 0; i < dataTable.Rows.Count; i++) { int num = (int)dataTable.Rows[i]["EquipmentIRecordID"]; foreach (GridViewRow gridViewRow in this.gvEquipment.Rows) { CheckBox checkBox = (CheckBox)gridViewRow.Cells[0].FindControl("cbSel"); int num2 = (int)this.gvEquipment.DataKeys[gridViewRow.RowIndex]["RecordID"]; if (num2 == num) { checkBox.Checked = true; } else { checkBox.Checked = false; } } } } }