How to force a datagrid to redraw?

G

Guest

Hi,
I've a datagrid bound to a dataview, the problem is when I cancel the
row delete, one of the rows in the datagrid disppears. If there is only one
row in the grid that row disappears. If there are three rows and I cancel
the deletion of the first row then the last row will disappear. The funniest
part is the row will reappear if I click on the column header to sort it.
I read another post in this forum which mentioned forcing the grid to
redraw after cancelling the delete will solve the problem, but I can't find a
way to force the redraw. I've tried grid.refresh, currencymanager.refresh,
even cleared the databinding and rebound the grid, nothing happens.
Can someone help me please.

Thanks in advance,
Debi

*******************************************
Private Sub OnGrid_RowDeleting(ByVal sender As Object, ByVal e As
DataRowChangeEventArgs)
Try
If Not Deleterow(sender, e) Then
bUnDelete = True
End If
Catch ex As Exception
WriteToErrorLog(ex.Message & "----" & ex.StackTrace)
Finally

End Try
End Sub

Private Sub OnGrid_RowDeleted(ByVal sender As Object, ByVal e As
DataRowChangeEventArgs)
Try
If bUnDelete Then
e.Row.RejectChanges()
'''''''''''''''''''''''Redraw here????????????
End If
Catch ex As Exception
WriteToErrorLog( ex.Message & "----" & ex.StackTrace)
Finally

End Try
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top