ComponentOne List 8.0 for ActiveX
UnboundReadData Event

 

True DBList Reference> TDBList Events> UnboundReadData Event

UnboundReadData Event

The UnboundReadData event is fired when an unbound control (one with its DataMode property set to 1 - Unbound) requires data for display, such as when it is first loaded or the user scrolls the control display.

Syntax

object_UnboundReadData (ByVal RowBuf As TrueDBList80.RowBuffer, StartLocation As Variant, ByVal ReadPriorRows As Boolean)

Arguments

RowBuf is a RowBuffer object used to transfer row data to the control.

StartLocation is a variant bookmark that identifies the row to position to before fetching the next or previous page of records. If Null, the control is requesting the first or last page of records as determined by the ReadPriorRows argument.

ReadPriorRows is a Boolean that determines the direction in which rows are to be fetched. If True, the control is requesting records that precede StartLocation. If False, the control is requesting records that follow StartLocation.

Remarks

Event applies to TDBList and TDBCombo controls.

The RowBuf argument acts like a two-dimensional array of variants corresponding to the control cells being fetched. By populating its Value property with the appropriate data, your event procedure transfers rows from the unbound dataset to the control.

Use the row buffer's RowCount property to determine how many rows of data the control is requesting. Use its ColumnCount property to determine the number of columns to be populated.

The RowBuf argument is also used to store a set of variant bookmarks that uniquely identify rows in the unbound dataset. The format of these bookmarks is determined solely by your application. For example, they may be primary key fields, row numbers, or array indexes, depending upon the nature of the unbound dataset.

Your event procedure supplies bookmarks to the control by populating the row buffer's Bookmark property for each row returned.  Keep in mind that the bookmark-based TDBList properties and methods such as Bookmark, FirstRow, GetBookmark, and RowBookmark are also designed to work with these unbound bookmarks.

It is not necessary to fill the row buffer completely, and it is in fact acceptable to return no rows at all. The row buffer's RowCount property can be set to indicate that fewer rows were returned than requested. The control interprets this to mean that there are no more rows to retrieve in the indicated direction. Thus, it is only necessary to fill the row buffer completely if there are more valid rows to be retrieved.

Note: True DBList is very conservative in its assumptions about row counts and BOF/EOF conditions. As a result, it may seem that the UnboundReadData event fires "too often."  This should not be interpreted as a sign of inefficiency, but rather as an assurance that an unbound control performs accurately with large multi-user databases.

See Also

TDBList and TDBCombo Controls

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback