private void alunos_detDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { try { decimal midtermGrade = Convert.ToInt32(this.alunos_detDataGridView.Rows[e.RowIndex].Cells[3].Value); decimal finalGrade = Convert.ToInt32(this.alunos_detDataGridView.Rows[e.RowIndex].Cells[4].Value); decimal oralGrade = Convert.ToInt32(this.alunos_detDataGridView.Rows[e.RowIndex].Cells[5].Value); this.alunos_detDataGridView.Rows[e.RowIndex].Cells[9].Value = ((midtermGrade + finalGrade + oralGrade) / 3); if (alunos_detDataGridView.CurrentRow.Cells[0].Value.ToString() != null) { if ((midtermGrade + finalGrade + oralGrade / 3) >= 60) { this.alunos_detDataGridView.Rows[e.RowIndex].Cells[10].Value = "Aprovado"; } else { this.alunos_detDataGridView.Rows[e.RowIndex].Cells[10].Value = "Reprovado"; } } } catch { }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)