With DataGridView1 .Rows.Add("Math") .Rows.Add("English") .Rows.Add("Science") End With
cellendedit
event handler.
Try Dim colIndex As Integer = e.ColumnIndex If colIndex = 1 Then Dim DataGridView1cell As Integer = DataGridView1.CurrentRow.Cells(1).FormattedValue Select Case DataGridView1cell Case 0 To 24 DataGridView1.CurrentRow.Cells(2).Value = "E" DataGridView1.CurrentRow.Cells(3).Value = "1" Case 25 To 29 DataGridView1.CurrentRow.Cells(2).Value = "D-" DataGridView1.CurrentRow.Cells(3).Value = "2" Case 30 To 34 DataGridView1.CurrentRow.Cells(2).Value = "D" DataGridView1.CurrentRow.Cells(3).Value = "3" Case 35 To 39 DataGridView1.CurrentRow.Cells(2).Value = "D+" DataGridView1.CurrentRow.Cells(3).Value = "4" Case 40 To 44 DataGridView1.CurrentRow.Cells(2).Value = "C-" DataGridView1.CurrentRow.Cells(3).Value = "5" Case 45 To 54 DataGridView1.CurrentRow.Cells(2).Value = "C" DataGridView1.CurrentRow.Cells(3).Value = "6" Case 55 To 59 DataGridView1.CurrentRow.Cells(2).Value = "C+" DataGridView1.CurrentRow.Cells(3).Value = "7" Case 60 To 64 DataGridView1.CurrentRow.Cells(2).Value = "B-" DataGridView1.CurrentRow.Cells(3).Value = "8" Case 65 To 69 DataGridView1.CurrentRow.Cells(2).Value = "B" DataGridView1.CurrentRow.Cells(3).Value = "9" Case 70 To 74 DataGridView1.CurrentRow.Cells(2).Value = "B+" DataGridView1.CurrentRow.Cells(3).Value = "10" Case 75 To 79 DataGridView1.CurrentRow.Cells(2).Value = "A-" DataGridView1.CurrentRow.Cells(3).Value = "11" Case 80 To 100 DataGridView1.CurrentRow.Cells(2).Value = "A" DataGridView1.CurrentRow.Cells(3).Value = "12" Case Else DataGridView1.CurrentRow.Cells(2).Value = "0" DataGridView1.CurrentRow.Cells(3).Value = "0" End Select End If Catch ex As Exception MsgBox(ex.Message) End Try