ILiteGridTurboCtrl Interface The ActiveX/COM Grid Control API — coclass LiteGridTurboCtrl | Design-time OCX pattern

Note

Default dispinterface: _LiteGridTurboCtrl | Event source: _DLiteGridTurboCtrlEvents

Getting Started — Registered Mode

This is the traditional path: the OCX is registered once with regsvr32, you drop the control on a form at design time, and you get IntelliSense and native event handlers. Everything below is copy-paste. Deploying without admin rights instead? See Registration-Free Deployment.

Quick Start (30 seconds)

  1. Register the OCX once, from an elevated prompt: regsvr32 "C:\LiteGridTurbo\LiteGridTurbo_x64.ocx" (use LiteGridTurbo_x86.ocx for 32-bit Office).
  2. On your UserForm, right-click the Toolbox → Additional Controls → tick LiteGridTurboCtrl Class, then draw the control on the form.
  3. Name it lgGrid in the Properties window. Every event handler below is named after it, so if you call it something else, rename the handlers to match.
  4. Tools → References → tick LiteGrid Turbo 1.0 Type Library. This is what gives you IntelliSense; the control works without it, but you lose autocomplete.
  5. Add a standard module named modLiteGridLicense (below), then paste the form template into the form's code.
The one thing worth getting right

Keep the activation key in one place — the shared module below — and call EnsureLicensed from each form. Pasting the key into every form is how keys end up in screenshots and support emails.

modLiteGridLicense — shared module

Insert → Module, rename it to modLiteGridLicense, paste this whole block, and edit the two constants once. Leave LG_KEY empty to use the evaluation window signed into your evaluation copy of the OCX; paste your purchased key there to activate.

' ===== modLiteGridLicense — START ============================================
Option Explicit

Private Const LG_COMPANY As String = "Your Company"
Private Const LG_KEY     As String = ""      ' empty = use the evaluation window signed into your copy

Private m_activated As Boolean

' Activates once per process (activation is not stored, so it runs on every launch).
' Safe to call from every form.
' Never passes a placeholder key: an invalid key raises a run-time error,
' which would abandon the rest of your Initialize routine.
Public Sub EnsureLicensed(ByVal ctrl As Object)
    If m_activated Then Exit Sub
    If ctrl Is Nothing Then Exit Sub
    If Len(LG_KEY) = 0 Then Exit Sub          ' evaluation copy: nothing to activate
    On Error Resume Next
    ctrl.ActivateLicense LG_COMPANY, LG_KEY
    On Error GoTo 0
    m_activated = True
End Sub
' ===== modLiteGridLicense — END ==============================================

Canonical per-form template

Paste into the form's code module. Assumes a design-time control named lgGrid and the modLiteGridLicense module above.

Verified against a real Excel host.

Option Explicit

' ---- setup ----------------------------------------------------------------
Private Sub UserForm_Initialize()
    On Error GoTo Fail

    EnsureLicensed Me.lgGrid

    ' Columns first, then rows.
    Me.lgGrid.AddColumn "Name", 150
    Me.lgGrid.AddColumn "Department", 150
    Me.lgGrid.AddColumn "Salary", 100

    Me.lgGrid.AddRow Array("John Smith", "Engineering", 95000)
    Me.lgGrid.AddRow Array("Jane Doe", "Marketing", 87000)
    Me.lgGrid.AddRow Array("Bob Wilson", "Finance", 102000)

    ' Optional niceties
    Me.lgGrid.Theme = 0                    ' 0=Light 1=Dark 2=Excel-Classic 3=High-Contrast
    Me.lgGrid.ShowFilterButtons = True
    Exit Sub

Fail:
    MsgBox "LiteGrid Turbo init failed: " & Err.Number & " " & Err.Description, vbCritical
End Sub

' ---- native events -------------------------------------------------------
' Registered mode wires these by NAME: <controlName>_<EventName>. No WithEvents.
' Pick them from the VBA editor's object/procedure dropdowns to get the exact
' signature — a typo in the name means the handler is simply never called.

Private Sub lgGrid_ItemClick(ByVal rowIndex As Long, ByVal columnIndex As Long)
    Debug.Print "clicked row " & rowIndex & ", col " & columnIndex
End Sub

Private Sub lgGrid_CellValueChanged(ByVal rowIndex As Long, ByVal columnIndex As Long, _
                                     ByVal oldValue As Variant, ByVal newValue As Variant)
    Debug.Print "cell " & rowIndex & "," & columnIndex & ": " & _
                CStr(oldValue) & " -> " & CStr(newValue)
End Sub

' Cancellable: set Cancel = True to veto the operation.
Private Sub lgGrid_BeforeRowDelete(ByVal rowIndex As Long, Cancel As Boolean)
    If MsgBox("Delete this row?", vbYesNo + vbQuestion) = vbNo Then
        Cancel = True
    End If
End Sub

' ---- teardown ------------------------------------------------------------
' On Error Resume Next because by the time this runs the control's window
' may already have been destroyed with the form.
Private Sub UserForm_Terminate()
    On Error Resume Next
    Me.lgGrid.Clear
End Sub
Access: peel the wrapper with .Object

Access wraps ActiveX controls, so Me.lgGrid gives you Access's wrapper rather than the grid. Take a typed reference once and use that:

Private m_grid As LiteGridTurboLib.LiteGridTurboCtrl

Private Sub Form_Load()
    Set m_grid = Me.lgGrid.Object      ' .Object peels Access's wrapper
    EnsureLicensed m_grid
    m_grid.AddColumn "Name", 150
End Sub

Event handlers stay named after the control (lgGrid_ItemClick), not after m_grid. In Excel/MSForms no .Object is needed — Me.lgGrid is the control already.

▶ Data Loading 15 members

Methods for loading data from arrays, Excel Ranges, Recordsets, and JSON. Includes async loading, streaming, and preset modes.

MemberParametersReturnsDescription
LoadFromArraydata As VariantLoad data from a 2D Variant array
LoadFromRangepRange As ObjectLoad data from an Excel Range object
LoadFromRecordsetpRecordset As ObjectLoad data from a DAO or ADO Recordset
LoadFromJsonjson As StringLoad data from a JSON array-of-objects string
AutoDetectColumnsfirstRowIsHeader As BooleanDetect column types; optionally treat first row as headers
ClearRemove all data and columns
GetRowCountLongReturn total number of rows
GetColumnCountLongReturn total number of columns
QuickBinddata As Variant, firstRowIsHeader As BooleanOne-call grid setup: load data, detect types, auto-fit, enable filters/sort/status bar
CancelLoadCancel an in-progress load operation
IsLoadingProperty, RBooleanTrue if a load operation is currently in progress
SetModemodeName As StringApply named preset: "Excel", "ReadOnly", "Dashboard", "DataEntry"
BeginStreamingStart streaming mode — suppresses sort/filter until EndStreaming
AppendRowsdata As VariantAppend rows from 2D array during streaming (no full reload)
EndStreamingEnd streaming — rebuild view order, apply sort/filter

Per-Member Usage

' LoadFromArray — load from 2D array
Dim data(1 To 1000, 1 To 5) As Variant
Dim i As Long
For i = 1 To 1000
    data(i, 1) = "Item " & i
    data(i, 2) = Int(Rnd * 100)
    data(i, 3) = Round(Rnd * 999.99, 2)
Next
m_grid.LoadFromArray data

' LoadFromRange — load from Excel Range
m_grid.LoadFromRange ActiveSheet.Range("A1:F500")

' LoadFromRecordset — load from DAO/ADO Recordset
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM Orders")
m_grid.LoadFromRecordset rs
rs.Close

' LoadFromJson — load from JSON string
m_grid.LoadFromJson "[{""name"":""Alice"",""age"":30},{""name"":""Bob"",""age"":25}]"

' AutoDetectColumns — first row becomes headers
m_grid.AutoDetectColumns True

' Clear — remove all data and columns
m_grid.Clear

' GetRowCount / GetColumnCount — query dimensions
Debug.Print "Rows: " & m_grid.GetRowCount
Debug.Print "Columns: " & m_grid.GetColumnCount

' CancelLoad — cancel in-progress load
m_grid.CancelLoad

' IsLoading (Property) — check if loading
If m_grid.IsLoading Then m_grid.CancelLoad
▶ Column Management 10 members

Methods for adding, sizing, and configuring columns.

MemberParametersReturnsDescription
AddColumnheader As String, width As LongAdd a column with header text and pixel width
SetColumnWidthcolumnIndex As Long, width As LongSet column width in pixels
GetColumnWidthcolumnIndex As LongLongGet column width in pixels
SetColumnHeadercolumnIndex As Long, header As StringSet column header text
GetColumnHeadercolumnIndex As LongStringGet column header text
SetColumnVisiblecolumnIndex As Long, visible As BooleanShow or hide a column
AutoFitColumnsAuto-size all columns to fit their content
SetColumnAutoSizecolIndex As Long, mode As LongSet auto-size mode: 0=None, 1=Content, 2=Header, 3=Both, 4=Fill
SetColumnAlignmentcolumnIndex As Long, alignment As LongSet column alignment: 0=Left, 1=Center, 2=Right
GetColumnAlignmentcolumnIndex As LongLongGet column alignment: 0=Left, 1=Center, 2=Right

Per-Member Usage

' AddColumn — add columns with header and width
m_grid.AddColumn "Name", 150
m_grid.AddColumn "Score", 80

' SetColumnWidth / GetColumnWidth — resize columns
m_grid.SetColumnWidth 0, 200
Dim w As Long: w = m_grid.GetColumnWidth(0)

' SetColumnHeader / GetColumnHeader — rename columns
m_grid.SetColumnHeader 0, "Customer Name"
Dim h As String: h = m_grid.GetColumnHeader(0)

' SetColumnVisible — show/hide columns
m_grid.SetColumnVisible 3, False  ' Hide column 3

' AutoFitColumns — auto-size all columns
m_grid.AutoFitColumns

' SetColumnAutoSize — per-column auto-size mode
m_grid.SetColumnAutoSize 0, 3  ' Fit to header and content
m_grid.SetColumnAutoSize 4, 4  ' Fill remaining width
▶ Row Management 6 members

Methods for adding, inserting, deleting, sizing, and enabling/disabling rows.

MemberParametersReturnsDescription
AddRowvalues As VariantAppend a row with values
InsertRowrowIndex As Long, values As VariantInsert a row at a specific index
DeleteRowrowIndex As LongDelete a single row
DeleteSelectedRowsDelete all currently selected rows
SetRowEnabledrowIndex As Long, enabled As BooleanMark a row as enabled or disabled. Disabled rows render with Text_Disabled / State_Disabled tint and skip input.
ClearAllRowStatesReset every row to the Normal state. Clears all per-row enabled/disabled flags.

Per-Member Usage

' AddRow — append a row
m_grid.AddRow Array("Charlie", 78, "Active")

' InsertRow — insert at specific index
m_grid.InsertRow 0, Array("First Row", 100, "Top")

' DeleteRow — delete a single row
m_grid.DeleteRow 5

' DeleteSelectedRows — delete all selected rows
m_grid.DeleteSelectedRows

' SetRowEnabled — grey out a row and skip input
m_grid.SetRowEnabled 3, False
m_grid.SetRowEnabled 3, True   ' Restore

' ClearAllRowStates — restore every row to Normal
m_grid.ClearAllRowStates
▶ Cell Access 8 members

Methods for reading and writing individual cell values, colors, and formatting.

MemberParametersReturnsDescription
GetCellValuerow As Long, col As LongStringGet cell value as String
SetCellValuerow As Long, col As Long, value As StringSet cell value as String
GetCellrow As Long, col As LongVariantGet cell value as typed Variant
SetCellrow As Long, col As Long, value As VariantSet cell value as typed Variant
SetCellFontStylerow As Long, col As Long, style As LongSet cell font style: 0=Normal, 1=Bold, 2=Italic, 3=BoldItalic
SetCellColorrow As Long, col As Long, backColor As Long, foreColor As LongSet per-cell back and fore color override
ClearCellColorrow As Long, col As LongClear per-cell color override
SetCellRangestartRow As Long, startCol As Long, data As VariantBulk cell update from a 2D Variant array

Per-Member Usage

' GetCellValue / SetCellValue — string-based cell access
m_grid.SetCellValue 0, 1, "Updated"
Dim val As String: val = m_grid.GetCellValue(0, 1)

' GetCell / SetCell — typed Variant access
m_grid.SetCell 0, 2, 42.5     ' Double
m_grid.SetCell 0, 3, True      ' Boolean
m_grid.SetCell 0, 4, Now()     ' Date
Dim v As Variant: v = m_grid.GetCell(0, 2)

' SetCellFontStyle — bold, italic, or both
m_grid.SetCellFontStyle 0, 0, 1  ' Bold
m_grid.SetCellFontStyle 1, 0, 3  ' Bold + Italic
▶ Selection 8 members

Methods and properties for selecting rows, cells, and querying the selection state.

MemberParametersReturnsDescription
SelectRowrowIndex As LongSelect a row by index
SelectAllSelect all rows
ClearSelectionDeselect all rows
GetSelectedRowLongReturn first selected row index, or -1 if none
GetSelectedRowsVariantReturn selected row indices as array
IsRowSelectedrowIndex As LongBooleanCheck if a specific row is selected
SelectionModeProperty, R/WLongControls selection behavior. 0=Row: click selects entire row, Up/Down arrow nav. 1=Cell: click selects single cell, all 4 arrow keys navigate, Shift creates rectangular block. 2=Column: click selects entire column, Left/Right arrow nav.
MultiSelectProperty, R/WBooleanEnable Ctrl+Click and Shift+Click multi-selection

Per-Member Usage

' SelectRow — select a specific row
m_grid.SelectRow 5

' SelectAll — select all rows
m_grid.SelectAll

' ClearSelection — deselect everything
m_grid.ClearSelection

' GetSelectedRow — first selected row (-1 if none)
Dim row As Long: row = m_grid.GetSelectedRow
If row >= 0 Then Debug.Print m_grid.GetCellValue(row, 0)

' GetSelectedRows — all selected row indices
Dim indices As Variant: indices = m_grid.GetSelectedRows
If IsArray(indices) Then
    Dim i As Long
    For i = LBound(indices) To UBound(indices)
        Debug.Print "Row " & indices(i)
    Next
End If

' IsRowSelected — check specific row
If m_grid.IsRowSelected(3) Then Debug.Print "Row 3 selected"

' SelectionMode (Property) — controls selection and navigation behavior
m_grid.SelectionMode = 0  ' Row: click selects entire row, Up/Down arrows
m_grid.SelectionMode = 1  ' Cell: click selects one cell, all 4 arrows navigate, Shift = block
m_grid.SelectionMode = 2  ' Column: click selects entire column, Left/Right arrows

' MultiSelect (Property) — enable multi-selection
m_grid.MultiSelect = True
▶ Sorting 4 members

Methods for single-column, multi-column, and natural sort with case control.

MemberParametersReturnsDescription
SortcolumnIndex As Long, sortOrder As LongSort by column: 0=Ascending, 1=Descending
SortExcolumnIndex As Long, sortMode As LongExtended sort: 0=Asc, 1=Desc, 2=AscNoCase, 3=DescNoCase, 4=Natural
SortMultispec As StringMulti-column sort (up to 3 levels): "col:direction,..."
ClearSortRestore original row order

Per-Member Usage

' Sort — single column ascending or descending
m_grid.Sort 0, 0  ' Column 0 ascending
m_grid.Sort 2, 1  ' Column 2 descending

' SortEx — extended sort modes
m_grid.SortEx 0, 4  ' Natural sort (File1, File2, File10)

' SortMulti — multi-column sort
m_grid.SortMulti "0:asc,2:desc"

' ClearSort — restore original order
m_grid.ClearSort
▶ Filtering 14 members

Text, numeric, regex, value-list, and range filters with state persistence.

MemberParametersReturnsDescription
SetColumnFiltercolIndex As Long, filterMode As Long, pattern As StringSet text filter: 0=Contains, 1=Equals, 2=StartsWith, 3=EndsWith, 4=Regex
SetColumnNumericFiltercolIndex As Long, mode As Long, threshold As DoubleNumeric filter: 5=GT, 6=LT, 7=GE, 8=LE, 10=NotEqual
SetColumnNumericFilterRangecolIndex As Long, minVal As Double, maxVal As DoubleNumeric range filter (inclusive)
SetColumnValueListFiltercolIndex As Long, acceptedValues As Variant, includeBlanks As BooleanFilter to specific values only
ClearColumnFiltercolIndex As LongRemove filter from a column
ClearAllFiltersRemove all column filters
GetFilteredRowCountLongReturn number of visible (filtered) rows
GetDistinctValuescolIndex As LongVariantReturn sorted array of unique values in a column
GetColumnFilterModecolIndex As LongLongReturn active filter mode, or -1 if none
GetColumnFilterPatterncolIndex As LongStringReturn active filter pattern string
GetColumnValueListFiltercolIndex As LongVariantReturn active value-list filter array, or Empty
GetFilterStateStringReturn all filters as JSON for persistence
SetFilterStatejsonState As StringRestore filters from previously saved JSON state
ShowFilterButtonsProperty, R/WBooleanShow filter icon buttons in column headers

Per-Member Usage

' SetColumnFilter — text filters
m_grid.SetColumnFilter 0, 0, "alice"        ' Contains "alice"
m_grid.SetColumnFilter 1, 4, "^\d{3}$"     ' Regex: exactly 3 digits

' SetColumnNumericFilter — numeric comparisons
m_grid.SetColumnNumericFilter 2, 5, 100  ' Column 2 > 100

' SetColumnNumericFilterRange — between min and max
m_grid.SetColumnNumericFilterRange 2, 50, 200

' SetColumnValueListFilter — allow specific values
m_grid.SetColumnValueListFilter 3, Array("Active", "Pending"), True

' ClearColumnFilter / ClearAllFilters
m_grid.ClearColumnFilter 0
m_grid.ClearAllFilters

' GetFilteredRowCount — visible row count
Debug.Print "Visible: " & m_grid.GetFilteredRowCount

' GetDistinctValues — unique values in a column
Dim vals As Variant: vals = m_grid.GetDistinctValues(3)

' GetColumnFilterMode — check if column is filtered
If m_grid.GetColumnFilterMode(0) >= 0 Then Debug.Print "Filtered"

' GetColumnFilterPattern — current filter text
Dim p As String: p = m_grid.GetColumnFilterPattern(0)

' GetColumnValueListFilter — current value list
Dim vl As Variant: vl = m_grid.GetColumnValueListFilter(3)

' GetFilterState / SetFilterState — save/restore filters
Dim state As String: state = m_grid.GetFilterState
m_grid.SetFilterState state

' ShowFilterButtons (Property) — header filter icons
m_grid.ShowFilterButtons = True
▶ Export 9 members

Methods for exporting grid data to CSV, JSON, HTML, clipboard, or 2D array.

MemberParametersReturnsDescription
ExportToCSVfilePath As StringExport grid data to a CSV file
ExportToJsonStringExport grid data as JSON array-of-objects
ExportToHTMLStringExport grid data as HTML table
CopySelectedToClipboardCopy selected rows as tab-delimited text to clipboard
GetDataArrayVariantReturn all data as a 2D Variant array
PasteFromClipboardPaste clipboard data into grid at current selection
ExportToCSVExfilePath As String, includeHidden As BooleanExport to CSV. includeHidden=True exports ALL rows regardless of filters.
CopyWithHeadersincludeHeaders As BooleanCopy selected rows to clipboard with optional column headers
PasteSpecialpasteMode As LongPaste with options: 0=ValuesOnly, 1=SkipBlanks

Per-Member Usage

' ExportToCSV — save to CSV file
m_grid.ExportToCSV "C:\Reports\data.csv"

' ExportToJson — get JSON string
Dim json As String: json = m_grid.ExportToJson

' ExportToHTML — get HTML table string
Dim html As String: html = m_grid.ExportToHTML

' CopySelectedToClipboard — copy to clipboard
m_grid.CopySelectedToClipboard

' GetDataArray — return all data as 2D array
Dim data As Variant: data = m_grid.GetDataArray
▶ Visual Properties 9 properties

Read/write properties controlling the grid's visual appearance, theme, and editing behavior.

PropertyTypeR/WDescription
GridLinesLongR/W0=None, 1=Horizontal, 2=Vertical, 3=Both
BackColorOLE_COLORR/WDefault row background color
ForeColorOLE_COLORR/WDefault text color
AlternateRowColorOLE_COLORR/WAlternating row background color. The same setting as the Surface_Alt theme role, so a later ApplyThemeJson that names that role replaces it.
AllowEditingBooleanR/WEnable in-cell editing
ShowRowNumbersBooleanR/WShow row number column
ShowTooltipsBooleanR/WShow tooltips for truncated text
ThemeLongR/W0=Light, 1=Dark, 2=Excel-Classic, 3=High-Contrast
EditAdvanceOnEnterBooleanR/WEnter commits edit and advances to next row

Per-Member Usage

' Theme — set visual theme
m_grid.Theme = 1  ' Dark theme

' GridLines — control grid lines
m_grid.GridLines = 3  ' Both horizontal and vertical

' BackColor / ForeColor / AlternateRowColor — color scheme
m_grid.BackColor = RGB(255, 255, 255)
m_grid.ForeColor = RGB(51, 51, 51)
m_grid.AlternateRowColor = RGB(245, 245, 250)

' AllowEditing — enable in-cell editing
m_grid.AllowEditing = True

' ShowRowNumbers — row number column
m_grid.ShowRowNumbers = True

' ShowTooltips — tooltips for truncated text
m_grid.ShowTooltips = True

' EditAdvanceOnEnter — Enter advances to next row
m_grid.EditAdvanceOnEnter = True
▶ Header Styling 8 properties

Read/write properties for customizing column header appearance.

PropertyTypeR/WDescription
HeaderBackColorOLE_COLORR/WHeader background color
HeaderForeColorOLE_COLORR/WHeader text color
HeaderHoverColorOLE_COLORR/WHeader hover background color
HeaderHoverForeColorOLE_COLORR/WHeader hover text color
HeaderFontNameStringR/WHeader font name
HeaderFontSizeLongR/WHeader font size in points
HeaderFontBoldBooleanR/WHeader bold text
HeaderHeightLongR/WHeader height in pixels

Per-Member Usage

' HeaderBackColor / HeaderForeColor — header colors
m_grid.HeaderBackColor = RGB(33, 37, 41)
m_grid.HeaderForeColor = RGB(255, 255, 255)

' HeaderHoverColor / HeaderHoverForeColor — hover state
m_grid.HeaderHoverColor = RGB(50, 55, 60)
m_grid.HeaderHoverForeColor = RGB(200, 220, 255)

' HeaderFontName / HeaderFontSize / HeaderFontBold — header font
m_grid.HeaderFontName = "Segoe UI"
m_grid.HeaderFontSize = 10
m_grid.HeaderFontBold = True

' HeaderHeight — header row height
m_grid.HeaderHeight = 32
▶ Row Appearance 8 properties

Read/write properties for row height, density, padding, font, and hover colors.

PropertyTypeR/WDescription
RowHeightLongR/WDefault row height (16-100 pixels)
RowDensityLongR/W0=Compact, 1=Normal, 2=Comfortable
CellPaddingLongR/WHorizontal padding (2-20 pixels)
TextVAlignLongR/W0=Top, 1=Center, 2=Bottom
RowFontNameStringR/WRow font name
RowFontSizeLongR/WRow font size in points
HoverBackColorOLE_COLORR/WRow hover background color
HoverForeColorOLE_COLORR/WRow hover text color

Per-Member Usage

' RowHeight — default row height
m_grid.RowHeight = 24

' RowDensity — 0=Compact, 1=Normal, 2=Comfortable
m_grid.RowDensity = 1

' CellPadding — horizontal cell padding
m_grid.CellPadding = 6

' TextVAlign — vertical text alignment
m_grid.TextVAlign = 1  ' Center

' RowFontName / RowFontSize — row font
m_grid.RowFontName = "Segoe UI"
m_grid.RowFontSize = 9

' HoverBackColor / HoverForeColor — hover state
m_grid.HoverBackColor = RGB(230, 240, 255)
m_grid.HoverForeColor = RGB(0, 0, 0)
▶ Selection Styling 2 properties

Read/write properties for customizing the selected row/cell colors.

PropertyTypeR/WDescription
SelectionBackColorOLE_COLORR/WSelected row/cell background color
SelectionForeColorOLE_COLORR/WSelected row/cell text color

Per-Member Usage

' SelectionBackColor / SelectionForeColor — selection colors
m_grid.SelectionBackColor = RGB(0, 120, 215)
m_grid.SelectionForeColor = RGB(255, 255, 255)
▶ Column Schema 4 members

Methods for setting column data types and display formats.

MemberParametersReturnsDescription
SetColumnTypecolIndex As Long, colType As LongSet column type: 0=Auto, 1=String, 2=Integer, 3=Double, 4=Date, 5=Boolean
GetColumnTypecolIndex As LongLongGet column type
SetColumnFormatcolIndex As Long, formatString As StringSet display format (e.g. "#,##0.00", "yyyy-mm-dd")
GetColumnFormatcolIndex As LongStringGet display format string

Per-Member Usage

' SetColumnType / GetColumnType — set/get column data type
m_grid.SetColumnType 2, 3  ' Column 2 = Double
Dim t As Long: t = m_grid.GetColumnType(2)

' SetColumnFormat / GetColumnFormat — display format
m_grid.SetColumnFormat 2, "#,##0.00"
m_grid.SetColumnFormat 4, "yyyy-mm-dd"
Dim fmt As String: fmt = m_grid.GetColumnFormat(2)
▶ Freeze Panes 6 members

Methods for freezing columns and rows so they remain visible during scrolling.

MemberParametersReturnsDescription
SetFrozenColumnscount As LongFreeze the first N columns from the left
GetFrozenColumnsLongGet number of frozen columns
SetFrozenRowscount As LongFreeze the first N rows from the top
GetFrozenRowsLongGet number of frozen rows
FreezeLineColorProperty, R/WLongColor of the freeze line separator (OLE_COLOR)
FreezeLineWidthProperty, R/WLongWidth of the freeze line separator in pixels

Per-Member Usage

' SetFrozenColumns / GetFrozenColumns — freeze columns
m_grid.SetFrozenColumns 2  ' Freeze first 2 columns
Dim n As Long: n = m_grid.GetFrozenColumns

' SetFrozenRows / GetFrozenRows — freeze rows
m_grid.SetFrozenRows 1  ' Freeze header row
Dim fr As Long: fr = m_grid.GetFrozenRows
▶ Icons 21 members

Methods for loading icons from files, assigning them to cells/columns/value mappings, and drawing built-in vector icons that adapt to theme, state, and DPI without any external image files.

MemberParametersReturnsDescription
LoadIconFromFilefilePath As StringLongLoad .ico, .bmp or .png file (PNG alpha preserved); returns icon ID
RemoveIconiconId As LongRemove a loaded icon
GetIconCountLongReturn number of loaded icons
SetCellIconrow As Long, col As Long, iconId As LongAssign icon to a specific cell
ClearCellIconrow As Long, col As LongRemove icon from a cell
GetCellIconrow As Long, col As LongLongGet icon ID assigned to a cell
SetColumnIconMapcolIndex As Long, value As String, iconId As LongMap a cell value to an icon automatically
ClearColumnIconMapcolIndex As LongRemove all icon mappings for a column
SetColumnDefaultIconcolIndex As Long, iconId As LongSet fallback icon when no mapping matches
SetColumnIconLayoutcolIndex As Long, layout As LongIcon layout: 0=None, 1=IconOnly, 2=IconLeft, 3=IconRight
AddIconThresholdcolIndex As Long, minVal As Double, maxVal As Double, iconId As LongAdd icon set threshold: cells with value in [minVal, maxVal) show iconId
ClearIconThresholdscolIndex As LongClear all icon set thresholds for a column
SetCellBuiltinIconrow As Long, col As Long, iconId As LongSet a built-in vector icon (LiteGridBuiltinIcon, 0–7) on a specific cell. Overrides column rules.
ClearCellBuiltinIconrow As Long, col As LongClear the built-in icon override on a specific cell
SetColumnBuiltinIconcolIndex As Long, iconId As LongSet a single built-in icon for every cell in a column
ClearColumnBuiltinIconcolIndex As LongRemove a column-wide built-in icon
SetColumnBuiltinIconMapcolIndex As Long, value As String, iconId As LongMap an exact display value to a built-in icon (e.g. "OK" → lgIconCheck)
AddBuiltinIconThresholdcolIndex As Long, minVal As Double, maxVal As Double, iconId As LongNumeric range rule for built-in icons: [minVal, maxVal); first match wins
SetColumnBuiltinIconDefaultcolIndex As Long, iconId As LongDefault built-in icon when no rule matches. Pass -1 to clear.
ClearColumnBuiltinIconRulecolIndex As LongClear all built-in icon rules for a column (per-cell overrides retained)
IconSizeProperty, R/WLongRuntime ImageList icon size in pixels (4–128). Rescales ImageList and invalidates vector geometry cache.

Built-in icon resolver priority (first match wins): cell built-in → column-wide built-in → value map → numeric threshold → column default → external icon (LoadIconFromFile) → none.

Per-Member Usage

' LoadIconFromFile — load icons
Dim iconOK As Long: iconOK = m_grid.LoadIconFromFile("C:\Icons\check.ico")
Dim iconWarn As Long: iconWarn = m_grid.LoadIconFromFile("C:\Icons\warning.ico")

' RemoveIcon / GetIconCount — manage loaded icons
m_grid.RemoveIcon iconOK
Debug.Print "Icons loaded: " & m_grid.GetIconCount

' SetCellIcon / ClearCellIcon / GetCellIcon — per-cell icons
m_grid.SetCellIcon 0, 0, iconOK
m_grid.ClearCellIcon 0, 0
Dim id As Long: id = m_grid.GetCellIcon(0, 0)

' SetColumnIconMap — auto-map values to icons
m_grid.SetColumnIconMap 3, "Active", iconOK
m_grid.SetColumnIconMap 3, "Error", iconWarn

' ClearColumnIconMap — remove all mappings
m_grid.ClearColumnIconMap 3

' SetColumnDefaultIcon — fallback icon
m_grid.SetColumnDefaultIcon 3, iconOK

' SetColumnIconLayout — icon position
m_grid.SetColumnIconLayout 3, 2  ' Icon on the left of text

' Built-in vector icons (no external files needed) — values 0..7
' SetCellBuiltinIcon — per-cell override
m_grid.SetCellBuiltinIcon 0, 3, 1   ' lgIconCheck
m_grid.ClearCellBuiltinIcon 0, 3

' SetColumnBuiltinIcon — whole column
m_grid.SetColumnBuiltinIcon 5, 6   ' lgIconStar
m_grid.ClearColumnBuiltinIcon 5

' SetColumnBuiltinIconMap — value-to-icon mapping
m_grid.SetColumnBuiltinIconMap 3, "OK",   1   ' lgIconCheck
m_grid.SetColumnBuiltinIconMap 3, "Fail", 2   ' lgIconCross
m_grid.SetColumnBuiltinIconMap 3, "Warn", 3   ' lgIconWarning

' AddBuiltinIconThreshold — numeric range rules
m_grid.AddBuiltinIconThreshold 2, 0,  50,  5   ' lgIconArrowDown
m_grid.AddBuiltinIconThreshold 2, 50, 80,  0   ' lgIconCircle
m_grid.AddBuiltinIconThreshold 2, 80, 101, 4   ' lgIconArrowUp

' SetColumnBuiltinIconDefault — fallback when no rule matches
m_grid.SetColumnBuiltinIconDefault 2, 7   ' lgIconDiamond
m_grid.SetColumnBuiltinIconDefault 2, -1  ' Clear default

' ClearColumnBuiltinIconRule — wipe all column-level rules
m_grid.ClearColumnBuiltinIconRule 2

' IconSize (Property) — runtime icon size in pixels (4..128)
m_grid.IconSize = 24
▶ Heatmap 3 members

Methods for enabling automatic color gradient backgrounds on numeric columns.

MemberParametersReturnsDescription
SetColumnHeatmapcolIndex As Long, enabled As BooleanEnable or disable heatmap coloring
SetHeatmapColorscolIndex As Long, lowColor As Long, midColor As Long, highColor As LongSet low/mid/high gradient colors
SetHeatmapRangecolIndex As Long, minVal As Double, maxVal As DoubleSet explicit value range (disables auto-range)

Per-Member Usage

' SetColumnHeatmap — enable heatmap on column
m_grid.SetColumnHeatmap 2, True

' SetHeatmapColors — custom gradient colors
m_grid.SetHeatmapColors 2, RGB(255, 200, 200), RGB(255, 255, 200), RGB(200, 255, 200)

' SetHeatmapRange — explicit min/max range
m_grid.SetHeatmapRange 2, 0, 100
▶ Conditional Formatting 6 members

Methods for adding, removing, and configuring conditional formatting rules with 9 rule types.

MemberParametersReturnsDescription
AddFormatRulecolIndex As Long, ruleType As Long, threshold As Variant, backColor As Long, foreColor As LongLongAdd rule: 0=GT, 1=LT, 2=Equal, 3=Contains, 4=Between, 5=Top10%, 6=Bottom10%, 7=Duplicate, 8=Unique
RemoveFormatRuleruleId As LongRemove a specific formatting rule
ClearFormatRulescolIndex As LongClear rules for column, or -1 for all columns
SetFormatRuleIconruleId As Long, iconId As LongAssociate an icon with a formatting rule
SetFormatRuleThreshold2ruleId As Long, threshold2 As VariantSet upper bound for Between rules (ruleType=4)
AddRowFormatRuleevalColumn As Long, ruleType As Long, threshold As Variant, backColor As Long, foreColor As LongLongAdd row-scope format rule: evaluates one column and colors that column's cell. Does not currently fill the whole row.

Remarks: AddRowFormatRule records a row scope, but the renderer evaluates rules per column and applies the colors only to the evaluated column's own cell, so in this build its visible effect is the same as AddFormatRule. To tint a whole row today, add one rule per column with the same threshold.

Per-Member Usage

' AddFormatRule — highlight values > 90 in green
Dim ruleId As Long
ruleId = m_grid.AddFormatRule(2, 0, 90, RGB(200, 255, 200), RGB(0, 100, 0))

' AddFormatRule — highlight duplicates in yellow
Dim dupRule As Long
dupRule = m_grid.AddFormatRule(0, 7, "", RGB(255, 255, 200), RGB(0, 0, 0))

' SetFormatRuleThreshold2 — Between rule (50-100)
Dim betweenRule As Long
betweenRule = m_grid.AddFormatRule(2, 4, 50, RGB(255, 255, 200), RGB(0, 0, 0))
m_grid.SetFormatRuleThreshold2 betweenRule, 100

' SetFormatRuleIcon — associate icon with rule
m_grid.SetFormatRuleIcon ruleId, iconOK

' RemoveFormatRule / ClearFormatRules — cleanup
m_grid.RemoveFormatRule ruleId
m_grid.ClearFormatRules 2   ' Clear column 2 rules
m_grid.ClearFormatRules -1  ' Clear ALL rules
▶ Sparklines 4 members

Methods for rendering in-cell line, bar, and win/loss charts.

MemberParametersReturnsDescription
SetColumnSparklinecolIndex As Long, sparkType As LongSet sparkline type: 0=None, 1=Line, 2=Bar, 3=WinLoss
SetSparklineDatarow As Long, col As Long, dataPoints As VariantSet sparkline data points as array of Doubles
SetSparklineDataCSVrow As Long, col As Long, csvData As StringSet sparkline data from comma-separated string
SetSparklineColorscolIndex As Long, lineColor As Long, fillColor As Long, highColor As Long, lowColor As LongSet sparkline colors for line, fill, high/low points

Per-Member Usage

' SetColumnSparkline — enable sparkline rendering
m_grid.SetColumnSparkline 4, 1  ' Line sparkline

' SetSparklineData — array method
m_grid.SetSparklineData 0, 4, Array(10.5, 20.3, 15.0, 25.7, 18.2)

' SetSparklineDataCSV — CSV string method
m_grid.SetSparklineDataCSV 1, 4, "12.0,18.5,14.2,22.1,16.8"

' SetSparklineColors — custom sparkline colors
m_grid.SetSparklineColors 4, RGB(0, 120, 215), RGB(220, 235, 252), _
    RGB(0, 176, 80), RGB(255, 0, 0)
▶ Validation 3 members

Methods for adding input validation rules to columns for in-cell editing.

MemberParametersReturnsDescription
AddValidationRulecolIndex As Long, ruleType As Long, param1 As Variant, param2 As VariantLongAdd rule: 0=Required, 1=MinLength, 2=MaxLength, 3=Regex, 4=NumericRange, 5=CustomList
RemoveValidationRuleruleId As LongRemove a specific validation rule
ClearValidationRulescolIndex As LongClear rules for column, or -1 for all

Per-Member Usage

' AddValidationRule — required field, min length
m_grid.AddValidationRule 0, 0, "", ""       ' Required
m_grid.AddValidationRule 0, 1, 2, ""        ' Min length 2

' AddValidationRule — numeric range 0-100
m_grid.AddValidationRule 2, 4, 0, 100

' AddValidationRule — regex pattern
m_grid.AddValidationRule 3, 3, "^[A-Z]{2}\d{4}$", ""

' RemoveValidationRule / ClearValidationRules
m_grid.RemoveValidationRule ruleId
m_grid.ClearValidationRules 0   ' Clear column 0
m_grid.ClearValidationRules -1  ' Clear ALL
▶ Editors 3 members

Methods for configuring in-cell dropdown and date picker editors.

MemberParametersReturnsDescription
SetColumnDropdownItemscolIndex As Long, items As VariantSet dropdown list items for in-cell editing
SetColumnDatePickercolIndex As Long, enable As BooleanEnable date picker for in-cell editing
SetColumnDropdownEditablecolIndex As Long, editable As BooleanEnable editable dropdown with autocomplete

Per-Member Usage

' SetColumnDropdownItems — dropdown list for editing
m_grid.SetColumnDropdownItems 3, Array("Active", "Inactive", "Pending")

' SetColumnDatePicker — date picker for editing
m_grid.SetColumnDatePicker 4, True
▶ Column Groups 5 members

Methods for creating collapsible multi-level column hierarchies.

MemberParametersReturnsDescription
AddColumnGrouptitle As String, childColumns As Variant, parentGroupId As LongLongCreate a column group (0 for top-level parent)
RemoveColumnGroupgroupId As LongRemove a column group
CollapseColumnGroupgroupId As LongCollapse a group (hides child columns)
ExpandColumnGroupgroupId As LongExpand a group (shows child columns)
ClearColumnGroupsRemove all column groups

Per-Member Usage

' AddColumnGroup — create a group spanning columns
Dim grp As Long
grp = m_grid.AddColumnGroup("Financial", Array(2, 3, 4), 0)

' CollapseColumnGroup / ExpandColumnGroup — toggle visibility
m_grid.CollapseColumnGroup grp  ' Hides child columns
m_grid.ExpandColumnGroup grp    ' Shows them again

' RemoveColumnGroup / ClearColumnGroups — cleanup
m_grid.RemoveColumnGroup grp
m_grid.ClearColumnGroups
▶ Column Layout 4 members

Methods for saving and restoring column widths, order, and visibility as JSON, and properties that gate the interactive reorder and resize gestures.

MemberParametersReturnsDescription
GetColumnLayoutStringReturn column layout as JSON string
SetColumnLayoutlayout As StringRestore column layout from JSON string
AllowColumnReorderProperty, R/WBooleanEnable drag-and-drop column reordering
AllowColumnResizeProperty, R/WBooleanEnable interactive column resizing by dragging a header edge. Default True. SetColumnWidth and AutoFitColumns are unaffected.

Remarks: AllowColumnResize gates the gesture only — the header-edge drag, the resize cursor, the double-click auto-fit on a border, and the header menu's Auto-Fit Column item (which is greyed, not removed). Programmatic sizing through SetColumnWidth, AutoFitColumns, SetColumnAutoSize and SetColumnLayout keeps working while it is False. Both AllowColumnReorder and AllowColumnResize take part in design-time property persistence.

Per-Member Usage

' GetColumnLayout / SetColumnLayout — save/restore layout
Dim layout As String: layout = m_grid.GetColumnLayout
' ... later ...
m_grid.SetColumnLayout layout

' AllowColumnReorder (Property) — drag-and-drop reordering
m_grid.AllowColumnReorder = True

' AllowColumnResize (Property) — lock the user out of dragging column edges
m_grid.AllowColumnResize = False
m_grid.SetColumnWidth 2, 120   ' still works: programmatic sizing is not gated
▶ Virtual Data Mode 9 members

Properties and methods for event-driven, host-owned data supply without materializing the entire host dataset in the grid. The grid asks for rows with the NeedRows event; the host answers with SupplyRows. There is no data-callback object — see the retirement note below.

MemberParametersReturnsDescription
DataModeProperty, R/WLong0=Embedded (default), 1=Virtual, 2=Turbo column-store
SetVirtualRowCountcount As LongDeclare the total row count of the host's dataset. Always discards cached rows, so growing and shrinking behave identically.
SupplyRowsrequestId As Long, generation As Long, firstRow As Long, data As VariantAnswer a NeedRows request with a 2-dimensional Variant array. Pass Empty/Null to decline. Legal to call from inside the handler.
InvalidateAllRowsSignal that the host's dataset changed: bumps the generation, discards the cache and refetches the viewport. The only invalidation method — range invalidation is deliberately not offered.
SetPrefetchMarginrows As LongRows of prefetch margin either side of the viewport. Widens the requested envelope only. Default 0.
PrefetchMarginProperty, RLongCurrent prefetch margin in rows, as last set by SetPrefetchMargin. Default 0.
GetVirtualDiagnosticsStringVirtual-mode diagnostics as a flat JSON object.
FillVirtualSyntheticLongDevelopment fixture. Fills every row the last paint reported missing from a deterministic in-process generator (cell text "R{row}C{col}"), no host involved. Returns the number of rows filled.
SetVirtualViewportToptopRow As LongDevelopment fixture. Places the viewport so topRow is the first visible row, as a scrollbar jump would. Clamped to the declared row count.

Per-Member Usage

' DataMode (Property) — switch to virtual mode
m_grid.DataMode = 1  ' Virtual mode

' SetVirtualRowCount — total row count
m_grid.SetVirtualRowCount 1000000  ' 1 million rows

' SupplyRows — answer the grid's NeedRows request
Private Sub LiteGrid1_NeedRows(ByVal requestId As Long, ByVal generation As Long, _
                                  ByVal firstRow As Long, ByVal lastRow As Long)
    Dim data() As Variant
    ' ... fill data(0 To lastRow - firstRow, 0 To colCount - 1) from your source ...
    m_grid.SupplyRows requestId, generation, firstRow, data
End Sub

' InvalidateAllRows — the host's dataset changed
m_grid.InvalidateAllRows

' SetPrefetchMargin / PrefetchMargin — ask for larger pages, then confirm
m_grid.SetPrefetchMargin 50
Debug.Print m_grid.PrefetchMargin   ' 50

' GetVirtualDiagnostics — flat JSON counters
Debug.Print m_grid.GetVirtualDiagnostics

' FillVirtualSynthetic / SetVirtualViewportTop — development/diagnostic fixtures.
' Useful for exercising the cache without wiring a real host data source. Not
' part of a normal production integration. 
m_grid.SetVirtualViewportTop 500000
Dim filled As Long: filled = m_grid.FillVirtualSynthetic
Retired members. SetDataCallback (DISPID 293) is retired and NotifyRowsChanged (DISPID 295) is withdrawn. Both are absent from the current typelib and neither DISPID has been reassigned. Data is supplied through the NeedRows event plus SupplyRows; invalidation is InvalidateAllRows.
Development fixtures, permanently public. FillVirtualSynthetic and SetVirtualViewportTop were built to exercise the cache/eviction/prefetch machinery without a real host data source. They are ordinary, permanently supported members of the v1 API surface — not a future removal candidate — but most integrations will never call either one directly; real data comes through NeedRows/SupplyRows as shown above.
▶ Computed Columns 2 members

Methods for setting VBA callbacks that calculate cell values dynamically.

MemberParametersReturnsDescription
SetComputedColumncolIndex As Long, callback As ObjectAttach a callback object exposing GetComputedValue(colIndex, rowIndex) for computed column values
ClearComputedColumncolIndex As LongRemove computed column callback

Per-Member Usage

' SetComputedColumn — column 4 computed by a class instance
' (the class exposes: Function GetComputedValue(ByVal colIndex As Long, ByVal rowIndex As Long) As Variant)
Dim calc As New clsComputed
m_grid.SetComputedColumn 4, calc

' ClearComputedColumn — remove callback
m_grid.ClearComputedColumn 4
▶ Renderers 4 members

Methods for setting custom cell renderers, mapping values to status badges, and enabling the BeforeCellPaint event.

MemberParametersReturnsDescription
SetColumnRenderercolIndex As Long, rendererType As LongSet renderer: 0=Default, 1=Checkbox, 2=Progress, 3=Sparkline, 4=Button, 5=Star, 6=Pill (status badge)
SetColumnPillMapcolIndex As Long, displayValue As String, pillStatus As LongMap an exact display value to a badge status for a renderer-6 column: 0=Neutral, 1=Good, 2=Warn, 3=Bad. Good/Warn/Bad use the theme's Status_Good, Status_Warn and Status_Bad roles; an unmapped value draws the neutral badge.
ClearColumnPillMapcolIndex As LongRemove every value mapping from a column. The pill renderer stays attached, so every value then draws the neutral badge.
EnableBeforeCellPaintProperty, R/WBooleanWhen True, BeforeCellPaint event fires for every cell

Per-Member Usage

' SetColumnRenderer — custom cell renderers
m_grid.SetColumnRenderer 1, 1  ' Checkbox renderer
m_grid.SetColumnRenderer 2, 2  ' Progress bar renderer
m_grid.SetColumnRenderer 3, 4  ' Button renderer

' SetColumnPillMap — status badges on a renderer-6 column
m_grid.SetColumnRenderer 5, 6  ' Pill renderer
m_grid.SetColumnPillMap 5, "Delivered", 1  ' Good
m_grid.SetColumnPillMap 5, "On Hold", 2    ' Warn
m_grid.SetColumnPillMap 5, "Cancelled", 3  ' Bad

' EnableBeforeCellPaint (Property) — custom painting
m_grid.EnableBeforeCellPaint = True
▶ Memory & Performance 7 members

Methods and properties for batch updates, memory optimization, and forced repaint.

MemberParametersReturnsDescription
BeginUpdateSuspend rendering for batch operations
EndUpdateResume rendering after batch operations
RefreshForce an immediate repaint
CompactModeProperty, R/WBooleanStore display text only (reduced memory for text-only grids)
CompactRelease excess memory capacity
EstimateMemoryLongReturn estimated memory usage in bytes
GetPaintMetricsStringGet paint performance metrics as JSON (avg/max paint time, cache hit rate)

Per-Member Usage

' BeginUpdate / EndUpdate — batch operations
m_grid.BeginUpdate
    Dim i As Long
    For i = 1 To 10000
        m_grid.AddRow Array("Item " & i, i * 1.5, "Active")
    Next
m_grid.EndUpdate

' Refresh — force immediate repaint
m_grid.Refresh

' CompactMode (Property) — text-only storage mode
m_grid.CompactMode = True

' Compact — release excess memory
m_grid.Compact

' EstimateMemory — check memory usage
Debug.Print "Memory: " & Format(m_grid.EstimateMemory / 1048576, "0.0") & " MB"
▶ Version & Diagnostics 17 members

Read-only version properties, diagnostic tools for benchmarking and error logging, and live runtime instrumentation (DPI, paint timings, cache hit ratios) for inspector UIs and performance monitoring.

MemberParametersReturnsDescription
VersionProperty, RStringVersion string (e.g. "1.0.0")
BuildDateProperty, RStringBuild date string (e.g. "2026-03-29")
VersionMajorProperty, RLongMajor version number
VersionMinorProperty, RLongMinor version number
VersionPatchProperty, RLongPatch version number
LastErrorProperty, RStringLast error message, or empty string if no error
RunBenchmarkbenchmarkId As LongStringRun benchmark: 0=Load, 1=Sort, 2=Paint, 3=Memory, 4=All. Returns JSON.
EnableDiagnosticLogenabled As BooleanEnable or disable diagnostic logging
GetFullDiagnosticsJSONStringCombined diagnostics JSON: memory, paint perf, grid state
HoveredRowProperty, RLongCurrently hovered row index, or -1 if none
CurrentDpiProperty, RLongEffective DPI for the grid window (e.g. 96, 120, 144, 192)
PerformanceStatsProperty, RStringAll engine stats as JSON: rows, icons, paint ms, cache hits, theme, DPI
CacheHitRatioProperty, RDoubleGeometry cache hit ratio, 0.0–1.0
GeometryRebuildsProperty, RLongCumulative count of icon-geometry cache rebuilds
AvgPaintMsProperty, RDoubleEMA-smoothed average paint time in milliseconds
ImageListIconCountProperty, RLongNumber of external icons currently held by the ImageList
GetResolvedIconrow As Long, col As LongStringInspector readback: returns kind/externalId/builtinId for the icon a cell currently shows

Per-Member Usage

' Version / BuildDate (Properties) — version info
Debug.Print "Version: " & m_grid.Version
Debug.Print "Built: " & m_grid.BuildDate

' VersionMajor / VersionMinor / VersionPatch
Debug.Print m_grid.VersionMajor & "." & m_grid.VersionMinor & "." & m_grid.VersionPatch

' LastError (Property) — check for errors
If m_grid.LastError <> "" Then
    MsgBox "Error: " & m_grid.LastError
End If

' RunBenchmark — performance test (returns JSON)
Dim results As String: results = m_grid.RunBenchmark(4)
Debug.Print results

' EnableDiagnosticLog — enable logging
m_grid.EnableDiagnosticLog True

' Runtime instrumentation — live read-only properties
Debug.Print "DPI: " & m_grid.CurrentDpi
Debug.Print "Hover row: " & m_grid.HoveredRow
Debug.Print "Avg paint: " & m_grid.AvgPaintMs & " ms"
Debug.Print "Cache hit: " & Format(m_grid.CacheHitRatio, "0.00%")
Debug.Print "Geometry rebuilds: " & m_grid.GeometryRebuilds
Debug.Print "External icons: " & m_grid.ImageListIconCount
Debug.Print m_grid.PerformanceStats     ' Full JSON snapshot

' GetResolvedIcon — diagnose which rule produced a cell's icon
Dim info As String: info = m_grid.GetResolvedIcon(0, 3)
Debug.Print info   ' e.g. "kind=builtin,externalId=-1,builtinId=1"
▶ Export 2 members

Methods for exporting grid data to PDF and XLSX formats. Both are self-contained with no external library dependencies.

MemberParametersReturnsDescription
ExportToPdffilePath As StringExport grid data to a PDF file. No external library needed.
ExportToXlsxfilePath As StringExport grid data to an XLSX file (Open XML). No external library needed.

Remarks: Both export methods preserve column widths, formatting, and filter state.

Examples

' Export to PDF
m_grid.ExportToPdf "C:\Reports\GridReport.pdf"

' Export to XLSX
m_grid.ExportToXlsx "C:\Reports\GridData.xlsx"
▶ Tree View 13 members

Methods and properties for displaying hierarchical data as an expandable/collapsible tree within the grid. Set parent-child relationships to activate tree mode.

MemberParametersReturnsDescription
SetTreeParentchildRow As Long, parentRow As LongSet parent for a row. parentRow = -1 for root. Activates tree mode.
GetTreeParentrow As LongLongGet parent row index (-1 if root)
GetTreeChildCountrow As LongLongGet number of direct children for a row
TreeExpanddisplayRow As LongExpand a tree node (show children)
TreeCollapsedisplayRow As LongCollapse a tree node (hide children)
TreeToggledisplayRow As LongToggle expand/collapse for a tree node
TreeExpandAllExpand all tree nodes
TreeCollapseAllCollapse all tree nodes
ClearTreeViewClear all parent-child relationships, return to flat mode
GetTreeDepthdisplayRow As LongLongGet nesting depth (0 = root level)
IsTreeExpandeddisplayRow As LongBooleanCheck if a tree node is currently expanded
TreeViewActiveProperty, RBooleanTrue if tree view mode is currently active
TreeIndentProperty, R/WLongIndent width in pixels per nesting level (default 16)

Remarks: Tree nodes display with expand/collapse arrows in the first visible column. Setting any parent-child relationship via SetTreeParent activates tree mode automatically. Use ClearTreeView to return to flat mode. Arrow Left/Right keys collapse/expand the focused node. TreeIndent controls the pixel offset per nesting depth.

Examples

' Build a 3-level hierarchy: Company > Department > Employee
' Assume rows are already loaded:
'   Row 0: "Acme Corp"
'   Row 1: "Engineering"
'   Row 2: "Alice"
'   Row 3: "Bob"
'   Row 4: "Sales"
'   Row 5: "Carol"

' Set root node (Company)
m_grid.SetTreeParent 0, -1   ' Acme Corp is root

' Set departments as children of company
m_grid.SetTreeParent 1, 0    ' Engineering -> Acme Corp
m_grid.SetTreeParent 4, 0    ' Sales -> Acme Corp

' Set employees as children of departments
m_grid.SetTreeParent 2, 1    ' Alice -> Engineering
m_grid.SetTreeParent 3, 1    ' Bob -> Engineering
m_grid.SetTreeParent 5, 4    ' Carol -> Sales

' Set a wider indent (24 pixels per level)
m_grid.TreeIndent = 24

' Expand all nodes to show full hierarchy
m_grid.TreeExpandAll

' Check tree state
Debug.Print "Tree active: " & m_grid.TreeViewActive   ' True
Debug.Print "Depth of Alice: " & m_grid.GetTreeDepth(2)  ' 2
Debug.Print "Children of Acme: " & m_grid.GetTreeChildCount(0)  ' 2
Debug.Print "Parent of Bob: " & m_grid.GetTreeParent(3)  ' 1 (Engineering)

' Check if a node is expanded
If m_grid.IsTreeExpanded(0) Then
    Debug.Print "Acme Corp is expanded"
End If

' Collapse just the Engineering department
m_grid.TreeCollapse 1

' Toggle Sales department
m_grid.TreeToggle 4

' Collapse everything
m_grid.TreeCollapseAll

' Clear tree view — return to flat grid
m_grid.ClearTreeView
Debug.Print "Tree active: " & m_grid.TreeViewActive   ' False
▶ Undo / Redo 7 members

Methods and properties for undoing and redoing cell edits, with support for grouping multiple edits into a single atomic undo step.

MemberParametersReturnsDescription
UndoBooleanUndo last cell edit. Returns True if successful.
RedoBooleanRedo last undone operation. Returns True if successful.
CanUndoProperty, RBooleanTrue if an undo operation is available
CanRedoProperty, RBooleanTrue if a redo operation is available
ClearUndoHistoryClear all undo/redo history
BeginUndoGroupBegin grouping multiple edits as a single undo step
EndUndoGroupEnd the current undo group

Remarks: Only cell edits are tracked (not sort, filter, or structural changes). BeginUndoGroup/EndUndoGroup wraps multiple SetCell or SetCellValue calls into one atomic undo step. Use CanUndo/CanRedo to enable or disable toolbar buttons. ClearUndoHistory frees memory used by the undo stack.

Examples

' Simple undo/redo
m_grid.SetCellValue 0, 0, "Original"
m_grid.SetCellValue 0, 0, "Changed"
m_grid.Undo   ' cell is now "Original"
m_grid.Redo   ' cell is now "Changed"

' Group 3 cell edits into one undo step
m_grid.BeginUndoGroup
m_grid.SetCellValue 0, 0, "A"
m_grid.SetCellValue 1, 0, "B"
m_grid.SetCellValue 2, 0, "C"
m_grid.EndUndoGroup

' One Undo call reverts all 3 cells
m_grid.Undo

' One Redo call restores all 3 cells
m_grid.Redo

' Use CanUndo / CanRedo for toolbar state
btnUndo.Enabled = m_grid.CanUndo
btnRedo.Enabled = m_grid.CanRedo

' Clear undo history to free memory
m_grid.ClearUndoHistory
Debug.Print "CanUndo: " & m_grid.CanUndo   ' False
Debug.Print "CanRedo: " & m_grid.CanRedo   ' False
▶ Filter Presets 4 members

Methods for saving, loading, and managing named filter presets. Presets capture all column filter states for quick recall.

MemberParametersReturnsDescription
SaveFilterPresetpresetName As StringSave current filter state as a named preset
LoadFilterPresetpresetName As StringLoad and apply a previously saved filter preset
DeleteFilterPresetpresetName As StringDelete a named filter preset
GetFilterPresetNamesStringGet all preset names as a JSON array

Remarks: Presets capture all column filter states including text, numeric, value-list, and range filters. Presets are stored in-memory — to persist them across sessions, save the names and use GetFilterState/SetFilterState for the actual filter data. GetFilterPresetNames returns a JSON array such as ["Sales View","Q4 Only"].

Examples

' Apply some filters, then save as a preset
m_grid.SetFilterText 0, "*Sales*"
m_grid.SetFilterNumeric 3, ">", 10000
m_grid.SaveFilterPreset "Sales View"

' Apply different filters, save another preset
m_grid.ClearAllFilters
m_grid.SetFilterText 1, "Q4*"
m_grid.SaveFilterPreset "Q4 Only"

' List all saved presets
Dim names As String
names = m_grid.GetFilterPresetNames
Debug.Print names   ' ["Sales View","Q4 Only"]

' Load a preset by name
m_grid.LoadFilterPreset "Sales View"

' Delete a preset
m_grid.DeleteFilterPreset "Q4 Only"

' Verify deletion
names = m_grid.GetFilterPresetNames
Debug.Print names   ' ["Sales View"]
▶ Row Reorder 2 members

Property and method for enabling drag-and-drop row reordering and programmatic row movement.

MemberParametersReturnsDescription
AllowRowReorderProperty, R/WBooleanEnable drag-and-drop row reordering. Default False.
MoveRowfromDisplayIndex As Long, toDisplayIndex As LongProgrammatically move a row to a new display position

Remarks: When AllowRowReorder is True, users can Alt+Click-drag rows to reorder them. The grid fires no special event — read the new order from the display indices after reordering. MoveRow works regardless of the AllowRowReorder property value, so rows can always be moved programmatically.

Examples

' Enable drag-and-drop row reordering
m_grid.AllowRowReorder = True

' Move row at display index 5 to the top (index 0)
m_grid.MoveRow 5, 0

' Move the last row to position 2
Dim lastRow As Long
lastRow = m_grid.RowCount - 1
m_grid.MoveRow lastRow, 2

' Disable reordering when done
m_grid.AllowRowReorder = False

' Programmatic reorder still works even when drag is disabled
m_grid.MoveRow 3, 0   ' Move row 3 to top
▶ Block Selection 2 members

Methods for selecting and querying rectangular cell blocks within the grid.

MemberParametersReturnsDescription
SelectBlockrowStart As Long, colStart As Long, rowEnd As Long, colEnd As LongSelect a rectangular block of cells. Clears previous selection.
GetBlockSelectionrowStart As Long ByRef, colStart As Long ByRef, rowEnd As Long ByRef, colEnd As Long ByRefBooleanQuery current block selection. Returns False if no block is active.

Remarks: Block selection is independent of row selection (SelectionMode = 0). Use SelectionMode = 1 (Cell) for cell-level operations. GetBlockSelection's four output parameters are filled via ByRef — always check the return value before reading the output parameters.

Examples

' SelectBlock — select a 10-row x 3-column block starting at row 0, col 1
m_grid.SelectBlock 0, 1, 9, 3

' GetBlockSelection — query the current block and print its bounds
Dim r1 As Long, c1 As Long, r2 As Long, c2 As Long
Dim hasBlock As Boolean
hasBlock = m_grid.GetBlockSelection(r1, c1, r2, c2)

If hasBlock Then
    Debug.Print "Block: (" & r1 & "," & c1 & ") to (" & r2 & "," & c2 & ")"
Else
    Debug.Print "No block selection active"
End If
▶ Grid State Persistence 2 members

Methods for serializing and restoring the complete grid layout and configuration state.

MemberParametersReturnsDescription
GetGridStateStringSerialize the full grid state (column widths, visibility, order, sort, filters, scroll position, frozen panes) to a JSON string.
SetGridStatejson As StringRestore grid state from a JSON string previously returned by GetGridState.

Remarks: Use for persisting user layout preferences. Store the JSON in a database field, registry key, or INI file. State includes everything the user can configure — column layout, filter state, sort order, scroll position, and frozen pane settings. Does NOT include data.

Examples

' GetGridState — capture the current layout as JSON
Dim stateJson As String
stateJson = m_grid.GetGridState()

' SetGridState — restore the layout later
m_grid.SetGridState stateJson

' Persist to a database field (example using DAO)
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT GridState FROM UserPrefs WHERE UserID=1")
If Not rs.EOF Then
    rs.Edit
    rs!GridState = m_grid.GetGridState()
    rs.Update
End If
rs.Close

' Restore from database on form load
Dim savedState As String
savedState = DLookup("GridState", "UserPrefs", "UserID=1")
If Len(savedState) > 0 Then
    m_grid.SetGridState savedState
End If
▶ Find & Column Chooser 4 members

Methods for showing the built-in find panel and column visibility chooser, and the property that controls keyboard type-ahead search.

MemberParametersReturnsDescription
ShowFindBarShow the built-in Ctrl+F find panel. Programmatic equivalent of pressing Ctrl+F.
HideFindBarHide the find panel and return focus to the grid.
ShowColumnChooserx As Long, y As LongShow a column visibility chooser popup at the specified screen coordinates. Pass 0,0 for auto-position.
MatchEntryProperty, R/WLongType-ahead search behaviour when the grid has focus. See the LiteGridMatchEntry enum (0 = Off, 1 = FirstLetter, 2 = Complete). Default 2.

Remarks: The find panel supports find-and-replace (Ctrl+H) with match case and whole word options. ShowColumnChooser displays a checklist of all columns — users can toggle visibility. Position 0,0 auto-centers near the mouse cursor. MatchEntry governs type-ahead, which is separate from the find panel: keystrokes search the focused column and move the focus row. Complete (2, the default and the behaviour of every earlier release) accumulates keystrokes into a prefix that resets after a short idle; FirstLetter (1) keeps only the last key, so repeating it cycles through matches; Off (0) stops keystrokes moving the focus row at all. Changing the mode discards any prefix already typed.

Examples

' ShowFindBar — open the find panel programmatically
m_grid.ShowFindBar

' HideFindBar — dismiss it and return focus to the grid
m_grid.HideFindBar

' ShowColumnChooser — auto-position (0,0)
m_grid.ShowColumnChooser 0, 0

' Typical usage: wire a toolbar button to toggle find
Private Sub btnFind_Click()
    m_grid.ShowFindBar
End Sub

' MatchEntry — cycle through rows sharing a first letter
m_grid.MatchEntry = 1   ' lgMatchEntryFirstLetter

' ...or turn type-ahead off so keystrokes never move the focus row
m_grid.MatchEntry = 0   ' lgMatchEntryOff
▶ UI Display 11 members

Properties that control built-in UI elements such as menus, status bar, auto-filter row, and loading overlay, plus viewport navigation — scrolling a row into view and tuning the mouse wheel.

MemberParametersReturnsDescription
ShowHeaderMenuProperty, R/WBooleanShow the built-in right-click context menu on column headers. Default True. Menu includes Sort, Filter, Hide Column, Auto-Fit, etc.
ShowStatusBarProperty, R/WBooleanShow a status bar below the data area. Default False. Displays selection count and aggregate metrics.
ShowBuiltinContextMenuProperty, R/WBooleanShow the built-in right-click context menu on cells. Default True. Menu includes Copy, Paste, Delete, Select All, etc.
ShowAutoFilterRowProperty, R/WBooleanShow auto-filter row with edit controls below column headers. Default False. Users type filter text directly.
StatusBarMetricsProperty, R/WStringComma-separated aggregate tokens for the status bar right section. Examples: "Count", "Sum", "Avg", "Min", "Max".
CheckAllVisiblecolIndex As LongCheck all visible rows in a checkbox column
UncheckAllVisiblecolIndex As LongUncheck all visible rows in a checkbox column
ShowLoadingOverlaytext As StringShow semi-transparent loading overlay with centered text
HideLoadingOverlayHide the loading overlay
ScrollToViewrowIndex As LongScroll the minimum distance needed to bring a view row into the scrollable band. Does nothing if the row is already fully visible.
WheelScrollRowsProperty, R/WLongRows scrolled per mouse-wheel notch. -1 = automatic (system setting), 0 = wheel scrolling disabled, n > 0 = exactly n rows. Default -1.

Remarks: Set ShowHeaderMenu = False and handle BeforeHeaderMenu events for custom header menus. The auto-filter row provides instant text filtering — each column gets an edit box that filters as the user types. ScrollToView takes a VIEW index — the same space as GetCellValue, so it respects the current sort and filter — and raises "Row index is out of range." for an index outside that space; header, frozen rows and the aggregate footer are excluded from the band it scrolls into. WheelScrollRows = -1 honours the Windows wheel setting capped at 60px per notch, while a positive count is honoured literally with no cap.

Examples

' Enable the status bar with Sum, Avg, and Count metrics
m_grid.ShowStatusBar = True
m_grid.StatusBarMetrics = "Sum,Avg,Count"

' Enable the auto-filter row for instant text filtering
m_grid.ShowAutoFilterRow = True

' Disable both built-in menus for a custom implementation
m_grid.ShowHeaderMenu = False
m_grid.ShowBuiltinContextMenu = False

' ScrollToView — bring a row into view after locating it
m_grid.ScrollToView 500

' WheelScrollRows — three rows per notch, honoured literally
m_grid.WheelScrollRows = 3

' ...or switch the wheel off entirely
m_grid.WheelScrollRows = 0
▶ Data Bars 3 members

Methods for enabling proportional data bar fills behind cell text in numeric columns.

MemberParametersReturnsDescription
SetColumnDataBarcolIndex As Long, enabled As BooleanEnable or disable proportional data bar fill for a numeric column.
SetDataBarColorcolIndex As Long, color As LongSet the data bar fill color (OLE_COLOR). Default is a blue gradient.
SetDataBarRangecolIndex As Long, minVal As Double, maxVal As DoubleSet explicit min/max range for data bars. Overrides auto-range detection.

Remarks: Data bars render a horizontal bar behind cell text, proportional to the cell's numeric value. By default, the range is auto-detected from the column's data. Use SetDataBarRange to set fixed bounds (e.g., 0 to 100 for percentages). Data bars work alongside heatmaps.

Examples

' Enable data bars on column 2 (Revenue)
m_grid.SetColumnDataBar 2, True

' Set a custom green color for the data bars
m_grid.SetDataBarColor 2, RGB(76, 175, 80)

' Set explicit range 0 to 100 for a percentage column
m_grid.SetColumnDataBar 4, True
m_grid.SetDataBarRange 4, 0, 100
m_grid.SetDataBarColor 4, RGB(33, 150, 243)

' Disable data bars on a column
m_grid.SetColumnDataBar 2, False
▶ Additional Properties 12 members

General-purpose properties and methods for controlling render style, empty state, sorting behavior, column editability, tooltips, theme customization, and per-column colors.

MemberParametersReturnsDescription
RenderStyleProperty, R/WLongRendering visual style. 0=Modern (default), 1=Flat (sharp edges), 2=Classic (3D beveled headers).
EmptyStateTextProperty, R/WStringText displayed when the grid has no data. Default is "No data to display".
AutoSortOnHeaderClickProperty, R/WBooleanWhen True (default), clicking a column header automatically sorts. Set False to handle sorting manually via ColumnClick event.
SetColumnReadOnlycolIndex As Long, readOnly As BooleanMark a column as read-only. Tab navigation skips read-only columns.
SetColumnTooltipcolIndex As Long, tooltipText As StringSet tooltip text for a column header
ShowProgressLabelProperty, R/WBooleanShow percentage text on progress bar cells (default True)
ApplyThemeJsonjson As StringOverride any of the 36 color roles from a JSON object of "RoleName":"#RRGGBB" entries. All or nothing: an unknown role, a malformed color or invalid JSON raises an error and leaves the theme unchanged. Roles not named keep their colors.
GetCurrentThemeJsonStringExport all 36 resolved theme colors as JSON, in the shape ApplyThemeJson accepts
SetColumnBackColorcolumnIndex As Long, color As OLE_COLORBackground color for every cell in one column. &HFFFFFFFF restores the themed background. Cell colors, conditional formats and the selection still paint over it. Not drawn in Virtual mode.
SetColumnForeColorcolumnIndex As Long, color As OLE_COLORText color for every cell in one column, checked against the background each cell actually gets. &HFFFFFFFF restores the themed text color. Not drawn in Virtual mode.
ApplyColumnStylesJsonjson As StringApply per-column colors from {"columns":[{"index":2,"back":"#FFF8E1","fore":"#5D4037"}]}. An omitted color is left as it was; "auto" restores the theme. All or nothing.
GetColumnStylesJsonStringExport the per-column colors in the shape ApplyColumnStylesJson accepts. Only columns carrying a color appear.

Remarks: RenderStyle affects the entire grid appearance. SetColumnReadOnly is useful for computed/formula columns or ID columns that users should not modify.

Examples

' Set flat render style
m_grid.RenderStyle = 1  ' lgRenderFlat

' Customize the empty state message
m_grid.EmptyStateText = "No records found. Try adjusting your filters."

' Disable auto-sort for manual handling
m_grid.AutoSortOnHeaderClick = False

' Make the ID column (col 0) read-only
m_grid.SetColumnReadOnly 0, True

' Per-column colors survive a theme change; save and restore them as one string
m_grid.SetColumnBackColor 2, RGB(238, 244, 250)
savedStyles = m_grid.GetColumnStylesJson()
m_grid.ApplyColumnStylesJson savedStyles
▶ Expression Engine 3 members

Lightweight computed column engine. Set expressions like [Price]*[Qty] or IF([Status]='Active',[Amount],0). Column-scoped, compiled AST, O(n) evaluation. NOT an Excel formula system.

MemberParametersReturnsDescription
SetColumnExpressioncolIndex As Long, expression As StringSet column expression. Compiled at call time. Invalid column refs fail immediately.
RecalculateColumncolIndex As LongRecalculate a single expression column
RecalculateAllRecalculate all expression columns

Supported functions: IF, ABS, ROUND, LEN, UPPER, LOWER, TRIM, LEFT, RIGHT, MID, MIN, MAX. Column refs: [ColumnName] (case-insensitive) or [#3] (by index). Division by zero returns NULL. Errors render as "#ERR".

Examples

' Set computed total column
m_grid.SetColumnExpression 4, "[Price]*[Qty]"

' Conditional expression
m_grid.SetColumnExpression 5, "IF([Status]='Active',[Amount],0)"

' String manipulation
m_grid.SetColumnExpression 6, "UPPER(LEFT([Name],1))"

' Recalculate after data changes
m_grid.RecalculateColumn 4
m_grid.RecalculateAll
▶ Licensing 8 members

Properties and methods for reading evaluation and license state, and for activating a purchased license.

MemberParametersReturnsDescription
LicenseStatusProperty, RStringLicense status string: TRIAL (evaluation window open), EXPIRED (window closed, or the copy carries no valid evaluation), EVAL, PRO, ENTERPRISE
LicenseStateProperty, RLongLicense state: 0=Valid (activated), 1=Trial (evaluation window open), 2=Expired. 3 (Invalid) is reserved and not currently produced
LicenseTypeProperty, RStringLicense type: trial, eval, pro, enterprise
LicenseExpiryProperty, RDateExpiry date: the evaluation end date signed into your copy, or an EVAL key's expiry. 0 for a perpetual license, or when the copy carries no valid evaluation
LicenseVersionProperty, RStringLicensed product version string
TrialDaysRemainingProperty, RLongWhole days left in the evaluation window signed into this copy, rounded up (0 once the window has closed or a license is activated)
ActivateLicensecompany As String, key As StringActivate a purchased license with company name and Ed25519 key. Applies to the current process only, so call it on every launch
GetLicenseInfoStringLicense info as JSON (schemaVersion, tier, product, company, expiryUtc, isPerpetual, daysRemaining, state). Informational only — no credential material.

Per-Member Usage

' Check license status
Debug.Print "Status: " & m_grid.LicenseStatus
Debug.Print "Days left: " & m_grid.TrialDaysRemaining

' ActivateLicense — activate with company and key
m_grid.ActivateLicense "Acme Corp", "BASE64_ED25519_KEY_HERE"

' Verify activation
If m_grid.LicenseState = 0 Then
    Debug.Print "Licensed: " & m_grid.LicenseType
End If

' GetLicenseInfo — full JSON snapshot, for a support ticket or diagnostics page
Debug.Print m_grid.GetLicenseInfo
Activation is per-process, not persistent. ActivateLicense applies to every grid instance created from the same loaded OCX file in that process, already created or created later, but the Software stores no activation state anywhere — no registry, no file. After the host process restarts, call ActivateLicense again before first use. See the EULA's licensing section for the full contractual statement.
When the evaluation window closes (or the copy carries no valid evaluation and no key is activated), the grid keeps displaying its data, but typing and clicking in the grid are blocked, data export and copying data out are refused, and printed, PDF and HTML output carries an evaluation notice. A Buy a License button appears on the grid. Everything returns as soon as ActivateLicense succeeds with a valid key.
▶ Event Bridge API 8 members

Registration-free deployment has no typelib to bind WithEvents to, so events are delivered through a callback object instead. These 8 methods attach, configure, and diagnose that bridge. This is the canonical reference for all 8 — events.html covers the same members from a usage/walkthrough angle and cross-links back here rather than duplicating the descriptions. See also Docs/LiteGrid_VBA_Event_Wrapper.md for the shipped VBA wrapper that turns the numeric eventId back into named events in both modes.

MemberParametersReturnsDescription
SetEventCallbackcallbackObject As Object, gridId As LongAttach a late-bound callback object exposing OnGridEvent(gridId, eventId, a1..a6, ByRef Cancel). gridId is echoed back verbatim on every callback — useful when one handler serves several grids.
ClearEventCallbackDetach every callback route (direct and macro). Idempotent; does not touch per-event enablement.
SetEventCallbackMacrohostApplication As Object, macroName As String, gridId As LongAttach a macro callback invoked through Application.Run instead of a callback object, e.g. "Module1.OnGridEvent". Macro existence is checked only on first invocation.
SetEventCallbackEnabledeventId As Long, enabled As BooleanEnable or disable delivery of one event to the callback bridge. Never affects native WithEvents delivery. Event 26 (BeforeCellPaint) cannot be enabled — see the permanent exception noted on events.html.
GetEventCallbackEnabledeventId As LongBooleanQuery whether an event is currently delivered to the callback bridge. Tier-B events (4, 13, 22, 23, 24, 28) are off by default.
GetEventCallbackInfoStringBridge diagnostics as JSON: per-route counters, last failure, owning thread id. Never restricted, so diagnostics stay readable even after an evaluation has expired.
ClearEventCallbackObjectDetach only the direct callback object, leaving a macro callback (if any) attached. Idempotent.
ClearEventCallbackMacroDetach only the macro callback, leaving a direct callback object (if any) attached. Idempotent.

Per-Member Usage

' SetEventCallback — attach a callback object (typically the form itself)
m_grid.SetEventCallback Me, 1

' Public Sub OnGridEvent must live on the callback object:
Public Sub OnGridEvent(ByVal gridId As Long, ByVal eventId As Long, _
                        ByVal a1 As Variant, ByVal a2 As Variant, _
                        ByVal a3 As Variant, ByVal a4 As Variant, _
                        ByVal a5 As Variant, ByVal a6 As Variant, _
                        ByRef Cancel As Boolean)
    Select Case eventId
        Case 2   ' ItemClick
            Debug.Print "clicked row " & a1 & ", col " & a2
    End Select
End Sub

' Opt in to a Tier-B high-frequency event (off by default)
m_grid.SetEventCallbackEnabled 22, True   ' CellHover
Debug.Print m_grid.GetEventCallbackEnabled(22)     ' True

' Macro route instead of a callback object
m_grid.SetEventCallbackMacro Application, "Module1.OnGridEvent", 1

' Diagnostics and teardown
Debug.Print m_grid.GetEventCallbackInfo
m_grid.ClearEventCallback