Object Reference > True DBGrid Events > UnboundGetRelativeBookmark Event |
UnboundGetRelativeBookmark Event
Fired when the drop-down needs a relative bookmark.
object_UnboundGetRelativeBookmark (StartLocation As Variant, ByVal Offset As Long, NewLocation As Variant, ApproximatePosition As Long)
Arguments
StartLocation is a bookmark that, together with Offset, specifies the row to be returned in NewLocation. A StartLocation of Null indicates a request for a row from BOF or EOF.
Offset specifies the relative position (from StartLocation) of the row to be returned in NewLocation. A positive number indicates a forward relative position; a negative number indicates a backward relative position.
NewLocation is a variable that receives the bookmark of the row specified by StartLocation plus Offset. If the row specified is beyond the first or the last row (that is, beyond BOF or EOF), then NewLocation should be set to Null.
ApproximatePosition is a variable that optionally receives the ordinal position of NewLocation. Setting this variable will enhance the ability of the grid to display its vertical scroll bar accurately. If the exact ordinal position of NewLocation is not known, you can set it to a reasonable, approximate value, or just ignore this parameter.
This event is mandatory when the DataMode property is set to 3 - Application. For DataMode 1 - Unbound, this event is optional. It is not used when the DataMode property is set to 2 - Unbound Extended.
This event is used in conjunction with the UnboundReadData or ClassicRead events when the grid needs to obtain positional information about your underlying data. By coding this event for DataMode setting 1 - Unbound, you can dramatically improve the performance of the grid. However, you do not need to change existing applications; you can ignore this event and they will continue to function properly.
Before returning from this event, you must set NewLocation to a valid bookmark. For example, if Offset is 1 (or -1), then you must return in NewLocation the bookmark of the row that follows (or precedes) StartLocation. However, if the requested row is beyond the first or last row, then you should return Null in NewLocation to inform the grid of BOF/EOF conditions.