pbSelectionEnable - cCJGrid
Determines if you can mark a row as selected
Type: Property
Access: Read/Write
Data Type: Boolean
Parameters: None
Syntax
Property Boolean pbSelectionEnable
| Access Type | Syntax |
|---|---|
| Read Access: | Get pbSelectionEnable to BooleanVariable |
| Write Access: | Set pbSelectionEnable to BooleanVariable/Value |
Description
pbSelectionEnable determines if row selection is enabled.
When False (the default) you cannot mark rows as selected.
When enabled you can select a single row, multiple rows or no rows. pbMultipleSelection determines if a single row or multiple rows can be selected. If pbMultipleSelection is false, only a single row is selected. When true, multiple rows can be selected. pbMultiSelectionMode determines whether the selected items are retained when the grid is scrolled and other rows are displayed.
Don't confuse row selection with the datasource object's SelectedRow function. The SelectedRow is the current row or the row that has the focus. A row selection is a row that happens to be selected or highlighted. Often, the SelectedRow and the row selection will be the same. If multi-selection is allowed, this will clearly not be the case.
You do not need to set pbSelectionEnable to true to edit grid data and, in most cases, setting this to true serves no functional purpose. You may use this for visual purposes. You may set this to true so that your current-row (SelectedRow) will be selected and appear in the selected row colors (piHighlightBackColor, piHighlightForeColor). Alternatively you can use pbShowRowFocus for this purpose.
GetIndexesForSelectedRows returns an array of indexes for all rows that are selected. This is used when multiple row selection is enabled. See pbMultipleSelection for a full description of this process.