Interface

GridDataSource


Description

Provides method signatures required for the DesktopGrid control to request and receive cell data from a data source.

Methods

Name

Parameters

Returns

Shared

CellAt

row As Integer, column As Integer

DesktopContainer

ColumnCount

Integer

PaintHeaderContentForColumn

g As Graphics, column As Integer

Boolean

PaintHeaderContentForRow

g As Graphics, row As Integer

Boolean

RowCount

Integer

RowHeight

Integer

WidthForColumn

column As Integer

Integer

Method descriptions


GridDataSource.CellAt

CellAt(row As Integer, column As Integer) As DesktopContainer

Return a DesktopContainer populated with the appropriate data for the row and column passed.


GridDataSource.ColumnCount

ColumnCount As Integer

Return the number of columns the DesktopGrid will display.


GridDataSource.PaintHeaderContentForColumn

PaintHeaderContentForColumn(g As Graphics, column As Integer) As Boolean

To handle drawing the column header for the column passed, draw to g parameter passed and return True to indicate your handled the drawing.


GridDataSource.PaintHeaderContentForRow

PaintHeaderContentForRow(g As Graphics, row As Integer) As Boolean

To handle drawing the row header for the row passed, draw to g parameter passed and return True to indicate your handled the drawing.


GridDataSource.RowCount

RowCount As Integer

Return the number of rows the DesktopGrid will display.


GridDataSource.RowHeight

RowHeight As Integer

Return the height of a single row.


GridDataSource.WidthForColumn

WidthForColumn(column As Integer) As Integer

Return the width of the column passed.

Notes

In order for a DesktopGrid control to be capable of displaying a virtually unlimited number of cells, it must load data into these cells dynamically when the control is initially drawn, as the user scrolls and as code executes that changes which cells are displayed. This is done by having an instance of a class that implements the GridDataSource interface. This instance will then be called by the DesktopGrid control via the methods defined by the interface which then takes requests for cells from the DesktopGrid control and returns the data from the ultimate source (a database or some other source) allowing the DesktopGrid to populate its cells.

To implement this interface:

  1. Choose an existing class such as the DesktopWindow or DesktopContainer the DesktopGrid is on or add a new class to your project.

  2. In the Inspector, click the Interfaces button then in the Interfaces dialog box that appears, click the checkbox next to GridDataSource to select it.

  3. In the Interfaces dialog box, click the OK button to select the interface for the class.

  4. This will add the methods to your class that will be called when the DesktopGrid need data.

Typically in the Opening of the DesktopGrid you would then assign the instance of class that is implementing the GridDataSource to the DataSource property of the DesktopGrid control.

Compatibility

Project Types

Desktop

Operating Systems

All

See also

Object parent class; DesktopGrid class, DesktopGrid with Database Example project