The Grid object allows you display a table of data, supplied either from your program or automatically loaded from a database. You define the basic appearance of the grid at design time and populate it with data at runtime.
When a cell in the grid is tapped, the grid's row and col properties are set and can be used in your program. While the fields in the grid cannot be directly edited by the user, you can change their values using TextMatrix and ValueMatrix for string and numeric fields respectively. Text and Value can be used for the currently selected cell.
Please see Section 13 of the Handbook for a more detailed description of the use of this object.
Properties and Methods Specific to this Object
|
.BINDTODATABASE dbName, dbFieldNameList [Where condition] |
Automatically loads a grid with data from a database. DbName is a database variable, set up by a previous DIM WITH RECORD statement. DbFIeldNameList is a list of fieldnames in the database, or the name of a Type structure in the database. Condition is an optional argument which selects which records to display. The format is the same as in an IF statement. |
|
.COL |
Get or set the current column. Range is 1 to COLS. |
|
.COLS |
Get the number of columns |
|
.COLTYPE colNo, type, formatString |
Set the type and format of a column. Columns default to text with null values. If you want a different type of data in a column, you must use this method to set it at runtime. ColNo is an existing column number in the Grid. Type is either "text","numeric" or "checkbox". FormatString depends on type: for "text", it will be the default value of the cell. For "numeric", it is a format string as used in the FORMAT statement. For "checkbox", the formatString is displayed to the right of a checkbox |
|
.COLWIDTH(colNo) |
Get or set the width of column columnNo. To hide a column, set to -1. |
|
.FONTMATRIX(rowNo, ColNo) |
Get or set the Font Number (0-7) for the cell. |
|
.HIDEGRIDLINES |
Hide the lines of the grid. |
|
.ROW |
Get or set the current row. Range is 1 to ROWS. Set this to 0 to unselect grid. |
|
.ROWDATA |
Get or set the rowdata value of the row. This is a user defined value. |
|
.ROWS |
Get or set the number of rows. |
|
.SHOWGRIDLINES |
Show the lines of the grid. |
|
.TEXT |
Get or set the value of the current cell with text in it. |
|
.TEXTMATRIX(rowNo, ColNo) |
Get or set the text value of the cell at rowNo, ColNo. |
|
.TOPROW |
Get or set the top row to display |
|
.VALUE |
Get or set the value of the current cell with a number in it. |
|
.VALUEMATRIX(rowNo, ColNo) |
Get or set the numeric value of the cell at rowNo, ColNo |
Properties Supported (Set at design time)
Cols, Has Scrollbar, Height, Left, Top, Visible Rows, Width
Other Methods Supported (See "Methods")
Add, Clear, Hide, HideGridLines, Redraw, Remove, Show, ShowGridLines