Cancel row deleting in DataGrid
It still doesn't redraw correctly, and I can't get values from the row to
evaluate if I must delete it or not.
Quote:
> <<
> <<I handle the RowDeleting event of the table bound to the datagrid like
this:
> <<Sub RowDeleting(ByVal sender As Object, ByVal e As
DataRowChangeEventArgs)
Quote:
> << e.Row.RejectChanges()
> <<End Sub
> <<
> <<The row doesn't delete, but it dissapear from the DataGrid until we
click on
> <<a column or make content change. I guess this is a known bug... is there
any
> <<work-around?
> <<
> Hi Etienne,
> It looks like this works with the RowDeleted event instead of the
RowDeleting event. Try using this code:
Quote:
> Private Sub dt_RowDeleted(ByVal sender As Object, ByVal e As
System.Data.DataRowChangeEventArgs) Handles dt.RowDeleted
Quote:
> e.Row.RejectChanges()
> End Sub
> Sincerely,
> Keith Fink
> Microsoft Developer Support
> This posting is provided "AS IS" with no warranties, and confers no
rights.