sorry for the late response.
here's my code:
Private Sub delCol_ButtonColumnClick(ByVal sender As Object, ByVal e As Leadit.ExtendedDataGrid.ButtonColumnEventArgs) Handles delCol.ButtonColumnClick
Dim row As Integer
Dim hourdiffBtn As Integer
Dim sBtn As DateTime
Dim eBtn As DateTime
Dim res As MsgBoxResult
row = Me.dtgCustomSched.CurrentRowIndex
res = MsgBox("Are you sure you want to delete the schedule on " + Me.dtgCustomSched.Item(row, 0), MsgBoxStyle.YesNo)
If res = MsgBoxResult.Yes Then
sBtn = Date.Parse(Me.dtgCustomSched.Item(row, 1))
eBtn = Date.Parse(Me.dtgCustomSched.Item(row, 2))
hourdiffBtn = getHrValue(sBtn, eBtn)
lastRowNumber = lastRowNumber - 1
Me.remainingHour2 = Me.remainingHour2 + hourdiffBtn
Me.txtLookUpHours.Text = remainingHour2.ToString
addSchedule.Table("ttcpcustomizedschedule").Rows.R emoveAt(row)
Else
Exit Sub
End If
End Sub
dtgcustomsched is the name of my datagrid
addsched is the name of the dataset
i made one of the datagrid cell as a customized button.. it already work fine with my other codes.. the problem only occur here
the error occurs on the line in bold.
also, this error only appears when i delete the last row on the datagrid, but if i delete anything rather than the last row everything works fine and no error is being detected
please help. thanx!
i am using vb.net 2002