private void Alumnos_Grid_CellBeginEdit(object sender, DataGridViewCellCancelEventArgs e) { if (this is FormularioNotasPracticasViewForm) { return; } if (Alumnos_Grid.Columns[e.ColumnIndex].Name == Recuparada.Name) { DataGridViewRow row = Alumnos_Grid.CurrentRow; Alumno_Practica item = row.DataBoundItem as Alumno_Practica; if (item.Calificacion == Resources.Labels.APTO_LABEL || item.Calificacion == Resources.Labels.SIN_CALIFICAR_LABEL) { e.Cancel = true; } Alumnos_Grid.Refresh(); } if (Alumnos_Grid.Columns[e.ColumnIndex].Name == FechaRecuperacion.Name) { DataGridViewRow row = Alumnos_Grid.CurrentRow; Alumno_Practica item = row.DataBoundItem as Alumno_Practica; if (!item.Recuperada) { e.Cancel = true; } Alumnos_Grid.Refresh(); } }
private void Alumnos_Grid_CellClick(object sender, DataGridViewCellEventArgs e) { if (this is FormularioNotasPracticasViewForm) { return; } if (Alumnos_Grid.CurrentRow == null) { return; } if (e.ColumnIndex == -1 || e.RowIndex == -1) { return; } if (Alumnos_Grid.Columns[e.ColumnIndex].Name == Calificacion.Name) { DataGridViewRow row = Alumnos_Grid.CurrentRow; Alumno_Practica item = row.DataBoundItem as Alumno_Practica; ModificaNotaPracticasAction(item); Alumnos_Grid.Refresh(); } }