private void CargarChulosDeAsistencia() { Decimal ID_DETALLE = Convert.ToDecimal(HiddenField_ID_DETALLE.Value); Programa _programa = new Programa(Session["idEmpresa"].ToString(), Session["USU_LOG"].ToString()); DataTable tablaEmpleadosAsistieron = _programa.ObtenerEmpleadosQueAsistieronAActividad(ID_DETALLE); Int32 contador = 0; if(tablaEmpleadosAsistieron.Rows.Count <= 0) { if (_programa.MensajeError != null) { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, _programa.MensajeError, Proceso.Advertencia); } else { Informar(Panel_FONDO_MENSAJE, Image_MENSAJE_POPUP, Panel_MENSAJES, Label_MENSAJE, "no se encontraron registros de asistencia para esta actividad.", Proceso.Advertencia); } } else { for(int i = 0; i < GridView_ControlAsistencia.Rows.Count; i++) { Decimal ID_EMPLEADO = Convert.ToDecimal(GridView_ControlAsistencia.DataKeys[i].Values["ID_EMPLEADO"]); String expresion = "ID_EMPLEADO = " + ID_EMPLEADO.ToString(); DataRow[] rowsEncontradas; rowsEncontradas = tablaEmpleadosAsistieron.Select(expresion); if (rowsEncontradas.Length > 0) { CheckBox check = GridView_ControlAsistencia.Rows[i].FindControl("CheckBox_Asistencia") as CheckBox; check.Checked = true; contador += 1; } } } Label_trabajadoresSeleciconados.Text = contador.ToString(); }