1 Previous Next 

DataGrid: Alert by a delete of rows using change row


Datagrid Alert by delete of rows

Be aware this tip is for the Windows Forms DataGrid, not for the DataGridView

AddHandler ds.Tables(0).RowDeleted, _
        New DataRowChangeEventHandler(AddressOf Row_Delete)

Private Sub Row_Delete(ByVal sender As Object, ByVal e _
    As DataRowChangeEventArgs)
        If e.Action = DataRowAction.Delete Then
            If MessageBox.Show("Delete row? ", _
            "", MessageBoxButtons.OKCancel) = DialogResult.Cancel Then
                e.Row.RejectChanges()
            End If
       End If
End Sub



1 Previous Next