Skip to main content

Grids

Overview​

Grid control allows users to add columns, rows and texts to a table.

  • Gird

Gird

Properties​

PropertyDescription
Col Count/Row CountSet the column count and row count of the current control.
Row Header Visible/Col Header VisibleWhether the row header or column header is visible.
Set Grid Text (int row, int col, wstring text)Set the texts within the grid.

Events​

addCallBack1

Callback NameCallback Function
on_select_gridThe callback after left-clicking a cell.
on_select_rowThe callback after selecting a row.
on_select_colThe callback after selecting a column.

Lua Script Example​


self.RowHeaderVisible = true
self.ColHeaderVisible = true
self.ColCount = 6
self.RowCount = 6
self:SetRowTitle(0, nx_widestr("1"))
self:SetRowTitle(1, nx_widestr("2"))
self:SetColTitle(0, nx_widestr("1"))
self:SetColTitle(1, nx_widestr("2"))
self:SetGridText(0, 0, nx_widestr("Text"))

-- When a cell is left-clicked, the callback function Grid_select_grid will be executed.
function Grid_select_grid(self)
nx_msgbox("Grid_select_grid")
end