Hi
I have a datagrid with 2 columns (Scores(Int) index 0 and Comment(nchar) index 1)
Comment columnvalue depends on score value.
This code works well in my cellvaluechanged event
If e.ColumnIndex = 0 Then
If Not IsDBNull(Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) Then
If Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value >= 0 And
Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value <= 5 Then
Me.dgvStudDisc.Rows(e.RowIndex).Cells(1).Value = "Very Poor"
Else
Me.dgvStudDisc.Rows(e.RowIndex).Cells(1).Value = DBNull.Value
End If
End If
End if
PROBLEM: when I enter a value in score column and want to delete it I get the above exception.
Can someone help me modify the code to handle this problem?
gbhs
I have a datagrid with 2 columns (Scores(Int) index 0 and Comment(nchar) index 1)
Comment columnvalue depends on score value.
This code works well in my cellvaluechanged event
If e.ColumnIndex = 0 Then
If Not IsDBNull(Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) Then
If Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value >= 0 And
Me.dgvStudDisc.Rows(e.RowIndex).Cells(e.ColumnIndex).Value <= 5 Then
Me.dgvStudDisc.Rows(e.RowIndex).Cells(1).Value = "Very Poor"
Else
Me.dgvStudDisc.Rows(e.RowIndex).Cells(1).Value = DBNull.Value
End If
End If
End if
PROBLEM: when I enter a value in score column and want to delete it I get the above exception.
Can someone help me modify the code to handle this problem?
gbhs