Hi To All
I am a VB.Net newbie
In my datagrid called dgvExamScores, if column5 cell is not empty, then column4 is 3 (3 is stored in textbox txtCreditValue).
Code works well But
PROBLEM:
When I delete a column5 value, column4 value of 3 is NOT deleted as expected.
Where is the error in my code?
is this event the correct one to use?
Here is my code
[XCODE]Private Sub dgvExamScores_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvExamScores.CellValidated
For i As Int32 = 0 To Me.dgvExamScores.Rows.Count - 1
If Not IsDBNull(Me.dgvExamScores.Rows(i).Cells(5).Value) Then
Me.dgvExamScores.Rows(i).Cells(4).Value = Me.txtCreditValue.Text
Else
IsDBNull(Me.dgvExamScores.Rows(i).Cells(4).Value)
End If
Next
End Sub[/XCODE]
Anyone Help Please!!!!
I am a VB.Net newbie
In my datagrid called dgvExamScores, if column5 cell is not empty, then column4 is 3 (3 is stored in textbox txtCreditValue).
Code works well But
PROBLEM:
When I delete a column5 value, column4 value of 3 is NOT deleted as expected.
Where is the error in my code?
is this event the correct one to use?
Here is my code
[XCODE]Private Sub dgvExamScores_CellValidated(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvExamScores.CellValidated
For i As Int32 = 0 To Me.dgvExamScores.Rows.Count - 1
If Not IsDBNull(Me.dgvExamScores.Rows(i).Cells(5).Value) Then
Me.dgvExamScores.Rows(i).Cells(4).Value = Me.txtCreditValue.Text
Else
IsDBNull(Me.dgvExamScores.Rows(i).Cells(4).Value)
End If
Next
End Sub[/XCODE]
Anyone Help Please!!!!