K
Karl
Hi
I have a weird problem while trying to delete a row from a dataview. If
there are only two rows, deleting the first row also deletes the second row.
It is okay if there are more than 2 rows everything works perfectly until it
gets to two rows, I hit delete and voila the last row goes as well.
Strangely if there is only one row it's fine, it just happens when there are
two rows and I delete the first one.
This is roughly what I'm doing:
For countRec = 0 To dataview.Count - 1
If dataview.Item(countRec )(0) = forId Then
dataview.Item(countRec ).Delete()
End If
Exit For
Next
When the count is 2 dataview.Item(countRec ).Delete() makes it 0
....any help appreciated
Thanks
I have a weird problem while trying to delete a row from a dataview. If
there are only two rows, deleting the first row also deletes the second row.
It is okay if there are more than 2 rows everything works perfectly until it
gets to two rows, I hit delete and voila the last row goes as well.
Strangely if there is only one row it's fine, it just happens when there are
two rows and I delete the first one.
This is roughly what I'm doing:
For countRec = 0 To dataview.Count - 1
If dataview.Item(countRec )(0) = forId Then
dataview.Item(countRec ).Delete()
End If
Exit For
Next
When the count is 2 dataview.Item(countRec ).Delete() makes it 0
....any help appreciated
Thanks