Grid
Overview
Grid control allows users to add columns, rows and texts to a table.
- Gird
Properties
Property | Description |
---|---|
Col Count/Row Count | Set the column count and row count of the current control. |
Row Header Visible/Col Header Visible | Whether the row header or column header is visible. |
Set Grid Text (int row, int col, wstring text) | Set the texts within the grid. |
Events
Callback Name | Callback Function |
---|---|
on_select_grid | The callback after left-clicking a cell. |
on_select_row | The callback after selecting a row. |
on_select_col | The 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