Cancel row deleting in DataGrid 
Author Message
 Cancel row deleting in DataGrid

I handle the RowDeleting event of the table bound to the datagrid like this:
Sub RowDeleting(ByVal sender As Object, ByVal e As DataRowChangeEventArgs)
  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?



Sat, 07 Aug 2004 02:22:46 GMT  
 Cancel row deleting in DataGrid

<<
<<I handle the RowDeleting event of the table bound to the datagrid like this:
<<Sub RowDeleting(ByVal sender As Object, ByVal e As DataRowChangeEventArgs)
<<  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:

    Private Sub dt_RowDeleted(ByVal sender As Object, ByVal e As System.Data.DataRowChangeEventArgs) Handles dt.RowDeleted
       e.Row.RejectChanges()
    End Sub

Sincerely,

Keith Fink
Microsoft Developer Support

This posting is provided AS IS with no warranties, and confers no rights.



Sat, 07 Aug 2004 03:36:41 GMT  
 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.



Sat, 07 Aug 2004 06:43:42 GMT  
 Cancel row deleting in DataGrid
Try using the datagrid's method refresh.

Best regards.

Jose

Quote:
>-----Original Message-----
>It still doesn't redraw correctly, and I can't get values
from the row to
>evaluate if I must delete it or not.


message

>> <<
>> <<I handle the RowDeleting event of the table bound to
the datagrid like
>this:
>> <<Sub RowDeleting(ByVal sender As Object, ByVal e As
>DataRowChangeEventArgs)
>> <<  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

- Show quoted text -

Quote:
>any
>> <<work-around?
>> <<

>> Hi Etienne,

>> It looks like this works with the RowDeleted event
instead of the
>RowDeleting event. Try using this code:

>>     Private Sub dt_RowDeleted(ByVal sender As Object,
ByVal e As
>System.Data.DataRowChangeEventArgs) Handles dt.RowDeleted
>>        e.Row.RejectChanges()
>>     End Sub

>> Sincerely,

>> Keith Fink
>> Microsoft Developer Support

>> This posting is provided "AS IS" with no warranties,
and confers no
>rights.

>.



Sun, 08 Aug 2004 01:21:34 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Canceling Row Delete in RowDeleting Event

2. How to delete a row in a datagrid.

3. Delete a row in a Datagrid using VB.net

4. DataGrid row delete

5. How to delete row from datagrid

6. Datagrids, DataSets and deleting Rows

7. DataGrid: how to handle deleted rows

8. Delete a row from datagrid

9. Disable Delete row function in Datagrid

10. Delete Row in Datagrid

11. DELETE all rows in datagrid

12. Datagrid - Prevent Delete / New Rows

 

 
Powered by phpBB® Forum Software