Bookmark Property (DataGrid) Example

In this example, when the user deletes a row in the unbound DataGrid control, the UnboundDeleteRow event is triggered, allowing you to manually delete the row from your data set, in this case, a simple array. The following code fragment shows how a bookmark is passed as an argument in the UnboundDeleteRow event to identify the row to be deleted.

Private Sub DataGrid1_UnboundDeleteRow(Bookmark As Variant)
  For i% = Bookmark + 1 To RowCount - 1
    For j% = 0 to MAXCOLS - 1
    UserData(j%, I% - 1) = UserData(j%, I%)
    Next j%
  Next I%
End Sub

Refer to the UnboundReadData event example for an example of assigning data to the Bookmark property.