ListBox.CellType
From Xojo Documentation
This item was deprecated in version 2019r2. Please use ListBox.CellTypeAt as a replacement. |
Property (As Integer )
aListBox.CellType(Row as Integer, Column as Integer) = newIntegerValue
or
IntegerValue = aListBox.CellType(Row as Integer, Column as Integer)
Supported for all project types and targets.
or
IntegerValue = aListBox.CellType(Row as Integer, Column as Integer)
Supported for all project types and targets.
Sets the type of the passed cell. Row and Column are zero-based.
Notes
Use the following class constants to set the CellType:
Class Constant | Value | Description |
---|---|---|
TypeDefault | 0 | Default column type. |
TypeNormal | 1 | Normal column. |
TypeCheckBox | 2 | Checkbox column. |
TypeEditable | 3 | Inline editable column using a TextField. Use TypeEditableTextField or TypeEditableTextArea instead. |
TypeEditableTextField | 3 | Inline editable column using a TextField. |
TypeEditableTextArea | 4 | Inline editable column using a TextArea. |
It is best programming practices to use the Class Constants to set the CellType and not the Integer value. See example below for using the Class Constant that are found in the list.
CellType values that are not TypeDefault (0) override ColumnType. For example, if ColumnType is TypeCheckBox, but a cell in the column has CellType set to TypeNormal, the cell will be normal.
Example
This code shows a checkbox in a single cell:
ListBox1.CellType(0, 4) = Listbox.TypeCheckbox // Cell in the 1st row, 5th column now shows a checkbox
To set or use the value of the Cell's checkbox see both the CellCheck property (boolean) and CellState method (Checked\Unchecked\Indeterminate). This code uses CellState to set the cell to be checked:
ListBox1.CellState(0, 4) = CheckBox.CheckedStates.Checked