Type: Boolean
Availability: Read or write at run time
The selected property specifies whether the current cell on the current sheet of a Table control is selected. The sheet, row, and column properties define the current cell. Accessing cells for this status in the fixed column and row area has special meaning if:
The current row and column are both in the fixed area, no action is taken and the selected property returns false.
The current row but not the column is in the fixed area, setting the selected property sets all non‑fixed cells in that column to the selected status. Getting the status in that situation returns true if all non‑fixed cells in that column are selected. If they are not all selected, it returns false.
The current column but not the row is in the fixed area, setting the selected property sets all non-fixed cells in that row to the selected status. Getting the status in that situation returns true if all non‑fixed cells in that row are selected. If they are not all selected, it returns false.
When the user clicks a non-fixed cell, all other selected cells are set to false, and the value of the selected property for the cell that is clicked is set to true. When the user clicks a non-fixed cell with the Shift key held down, the selected status of that cell is toggled. (The same effect can be achieved by using the arrow keys.)
When the user clicks a fixed column cell, all other selected cells are set to false, and the value of the selected property for all non-fixed cells in the clicked column is set to true. When the user clicks a fixed row cell, all other selected cells are set to false, and the value of the selected property of all non-fixed cells in the clicked row is set to true.
Both the Shift and the Ctrl keys can be used when a cell is selected in a table. Clicking a cell with the Ctrl key down toggles the selection of the clicked cell. Clicking a cell with the Shift key down causes the selection of all cells from the currently selected cell up to the cell that is being clicked when they are in the same row or column. (If they are not in the same row or column, only the cell that is clicked is selected.)
The value of the selectMode property also restricts the use of the Shift and Ctrl keys when selecting cells in tables. Use Ctrl+space bar to toggle the selected property status of the current cell, unless the style defined in the current selectMode property overrides that.
The code fragments in the following examples show the use of the selected property.
obj := tblPortfolio.itemObject; if obj = null or not tblPortfolio.selected then app.msgBox("You should select a share to sell", "Warning", MsgBox_Exclamation_Mark_Icon + MsgBox_OK_Only); return; endif;
if tblPortfolio.selected then if tblPortfolio.itemObject <> null then saveObject := tblPortfolio.itemObject; endif; endif;