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

RE: How to force a datagrid to redraw? by JasonLLind

JasonLLind
Thu Jul 14 14:15:01 CDT 2005

The Refresh() method?

Jason Lind

"Debi" wrote:

> 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

RE: How to force a datagrid to redraw? by debi

debi
Thu Jul 14 18:49:03 CDT 2005

As I had mentioned in my post, Refresh doesn't work.

"Jason L Lind" wrote:

> The Refresh() method?
>
> Jason Lind
>
> "Debi" wrote:
>
> > 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