The following example uses VirtualEvents mode to fill grid. Grid get data throught VirtualReadData event.
To try the example, place a SGGrid on a form. Paste the code into the Declarations section and press F5.
Private Sub SGGrid1_VirtualReadData(ByVal rowBuffer As IsgRowBuffer)
Dim i As Integer
'limit to 20 rows
If rowBuffer.RowIndex = 20 Then
rowBuffer.RowIndex = -1
Exit Sub
End If
For i = 0 To rowBuffer.ColumnCount - 1
rowBuffer.Value(i) = "Row: " & rowBuffer.RowIndex & " Col: " & (i + 1)
Next
End Sub
Private Sub SGGrid1_OnInit()
SGGrid1.DataColCount = 4
SGGrid1.DataMode = sgVirtualEvents
End Sub
Back to topic