Home > Language Reference > Classes > GridEx

Populate Method

Fills the grid control with the content of a Recordset.

Syntax

Public Sub Populate(ByRef objDatabase As Recordset, Optional ByVal bSecret As Boolean = True, Optional ByVal bClear As Boolean = True)

ParameterDescription
objDatabaseA properly initialized Recordset.
bSecretDetermine whether to mask private records or not.
bClearDetermines whether to clear the grid before adding new records.

Remarks

The Populate method fills the grid control with the content of a properly initialized Recordset object.

The objDatabase parameter specifies the Recordset whose content will be added to the grid control. It should be opened, either using the OpenTable or the OpenRecordset method. Note that after this method returns, the current record and the cursor value may have changed.

The bSecret parameter specifies whether to mask rows corresponding to Secret records. Refer to the Masked property for more information on masked rows.

The bClear parameter specifies whether the grid should be emptied before starting to browse the recordset. Setting this parameter to True is simply the same as calling Clear before this method.

This method is simply a shortcut for the following code:

Private Sub Populate(ByRef db As Recordset, ByVal bSecret As Boolean, ByVal bClear As Boolean)
  Grid1.Redraw=False
  If bClear Then Grid1.Clear

  db.MoveFirst
  While Not db.EOF
    Grid1.AddItem db.UniqueID, db.Secret And bSecret
    db.MoveNext
  Wend

  Grid1.Redraw=True
End Sub

However, since it can access internals of both Recordset and GridEx objects, it is much faster.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0N/A