Generic Grid Control — Methods

The following table lists and describes methods of the Generic Grid Control. Methods are accessed using the control's script editor.

Note: If a property or method in the script editor has two forms with the same name, one form exists for legacy support and the other form is current. When possible, use the current form. To select the current form, append .X. to the name of the object to which the property or method applies, and then enter the property or method name. For instance, enter MyObject.X.MyProperty. If a property or method in the script editor has only one form, the X method might or might not apply. The X method column in the table below indicates whether or not a property or method is accessible using the X method.

Browse by letter:     [A]     [C]     [E]     [G]     [I]     [R]     [S]

Method X Method Description

AboutBox

No

The AboutBox method displays an About dialog box for the control.

Syntax

AboutBox()

Example

The following examples launch an About dialog box for the control.

Copy
AboutBox
Sub ShowAboutBox()
 
    <Object>.AboutBox
 
End Sub

Sub ButtonTool_EventClick()

    Dim This : Set This = ButtonTool
    <Object>.AboutBox
 
End Sub

AddColumn

No

The AddColumn method adds a column to the grid.

Parameters
  • ColumnName (string) — the column header.
  • Width (int) — the width of the column, which can be affected by the ColumnsAutoSizing — property parameters.
  • HeaderAlignment (enum) — the alignment of header text:
  • 0Left
  • 1Center
  • 2Right

AddRow

No

The AddRow method adds a row to the grid.

AddRowToGroup

No

The AddRowToGroup method adds a row to a group of rows in the grid.

Parameters
  • GroupName (string) — the group name to which the row is added.

Clear

No

The Clear method clears the contents and values of the object.

Parameters
  • ClearColumns (bool) — if true, Clear() removes all columns from the grid as well as rows.

ExportToCSV

No

The ExportToCSV method exports the contents of the grid to a CSV file.

Parameters
  • ExportFilePath (string) — the path for the exported file.

GetCellCheckBoxValue

No

The GetCellCheckBoxValue method returns if the check box cell is checked or not. Script subtype is Boolean.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

GetCellData

No

The GetCellData method returns the data for a cell. Script subtype is string.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

GetCellDropListSelIndex

No

The GetCellDropListSelIndex method gets the index of the currently selected value in the list. Script subtype is integer.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

GetCellIsCheckBoxType

No

The GetCellIsCheckBoxType method returns if the cell is a check box or not. Script subtype is Boolean.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

GetCellValue

No

The GetCellValue method returns the value for a cell.

Script subtype is string.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

GetRowData

No

The GetRowData method retrieves background data for a row. Script subtype is string.

Parameters
  • Row (int) — the row to get data from.

GetRowIndexAdjustedForGroups

-

Obsolete

GetSelectedCells

No

The GetSelectedCells method returns the selected cells in an array. Script subtype is array.

GetSelectedRows

No

The GetSelectedRows method returns the selected rows in an array. Script subtype is array.

IsGroupRow

No

The IsGroupRow method returns true if the given row is a group header rather than a regular row. Script subtype is Boolean.

Parameters
  • Row (int) — the row ID.

Refresh

No

The Refresh method refreshes the grid's contents and applies setting changes.

RemoveRow

No

The RemoveRow method removes a row from the grid.

Parameters
  • Row (int) — the row to be removed.

ResetCellType

No

The ResetCellType method clears type on a cell.

Parameters
  • Column (int) — the column of the cell to be reset.
  • Row (int) — the row of the cell to be reset.

SetCellAlignment

No

The SetCellAlignment method sets the alignment for the text in the cell.

Parameters
  • Column (int) — the column of the cell.
  • Row (int) — the row of the cell.
  • Alignment (enum) — the alignment of the cell:
  • 0Left
  • 1Center
  • 2Right

SetCellCharLimit

No

The SetCellCharLimit method sets the maximum number of characters for a cell.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Limit (int) — the maximum number of characters.

No

The SetCellCheckBoxValue method sets the check box to be checked or not.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Value (bool) — the value of the cell: checked or unchecked.

SetCellColor

No

The SetCellColor method sets the background color of a cell.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Red (int) — the red value of the background cell color.
  • Green (int) — the green value of the background cell color.
  • Blue (int) — the blue value of the background cell color.

No

The SetCellColorRGB method sets the background color of a cell using a single RGB value.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • RGB (int) — the color value as RGB.

No

The SetCellData method sets the data for a cell (a hidden string associated with a cell).

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Data (string) — the value to set for the cell.

No

The SetCellDropList method sets the cell as a drop-down menu.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Values (array) — the values to populate the list.
  • Data (array) — the data for each of the values.

Note: The length of Values and Data must match.

SetCellDropListSelIndex

No

The SetCellDropListSelIndex method sets the drop-down menu selection by index.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Index (int) — the index to be selected.

SetCellDropListSelValue

No

The SetCellDropListSelValue method sets the drop-down menu selection by value.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Value (string) — the value to select from the drop-down menu.

No

The SetCellHyperlink method sets the cell to be a hyperlink.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Text (string) — the hyperlink text.
  • Link (string) — the hyperlink link.

No

The SetCellReadOnly method sets a cell to be read-only.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • ReadOnly (bool) — determines if the cell allows edits.

SetCellTextColor

No

The SetCellTextColor method sets the text color of a cell.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Red (int) — the red value of the text color.
  • Green (int) — the green value of the text color.
  • Blue (int) — the blue value of the text color.

SetCellTextColorRGB

No

The SetCellTextColorRGB method sets the text color of a cell using a single RGB value.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • RGB (int) — the color value as RGB.

No

The SetCellTextFormat method sets the text format for a cell that will limit user input.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Format (enum) — the preset text format for the cell:
  • 0Any
  • 1Uppercase
  • 2UDC
  • 3 — Numeric

SetCellTypeCheckBox

No

The SetCellTypeCheckBox method sets cell to be a check box.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.

SetCellValidChars

No

The SetCellValidChars method sets the valid characters that can be typed into a cell.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row containing the cell.
  • Limit (int) — the list of valid characters for a cell.

SetCellValue

No

The SetCellValue method sets the value for a cell. This method will throw an error if the specified cell does not exist, or if the specified column does not permit user values.

Parameters
  • Column (int) — the column containing the cell.
  • Row (int) — the row of the cell.
  • Value (string) — the value to set for the cell.

SetColumnVisible

No

The SetColumnVisible method shows or hides a column.

Parameters
  • Column (int) — the column to toggle visibility.
  • Visible (bool) — true shows the column; false hides the column.

SetCurSel

No

The SetCurSel method sets the current selection.

Parameters
  • Row (int) — the row to be selected.

SetDisplayFormat

No

The SetDisplayFormat method sets the display format for a column or a row (based on the value of the DisplayFormatOrientation property).

Parameters
  • Index (int) — the row or column number to be formatted.
  • Format (string) — the format for the cell in the row or column.

No

The SetDynamicGroupColumn method configures a column to group.

Parameters
  • Column (int) — the column to group grid data by.

SetFrozenColumns

No

The SetFrozenColumns method sets the number of columns to fix to the left of the grid.

Parameters
  • NumColumns (int) — the number of columns to freeze.

SetRowData

No

The SetRowData method sets background data for a row.

Parameters
  • Row (int) — the row to store data from.
  • Data (string) — the data to be stored.

No

The SetSortingColumn method sets the grid to sort data based on the given column's values.

Parameters
  • Ascending (bool) — true sorts A-Z; false sorts Z-A.
  • Col (int) — the column to sort.

Back to top