When you set a table control to any mode other than indicator mode, you can use the keyboard or the mouse to navigate through the table and change the values in its cells.
A table has two distinct states of operation: selection state, which is the default state, and edit state. These states determine how LabWindows/CVI processes keyboard and mouse input. In the selection state, you can navigate through the table and select and/or make different cells active. In the edit state, you can change the value of a particular cell.
When the table is in selection state, you can operate the table cells using the keyboard in the following ways:
You can select a range of cells by holding down the <Shift> key as you move the active cell. When you select a range of cells, you also can perform operations such as sorting, searching, copying, and pasting, on a group of cells.
You can use the mouse to select cells in the following ways:
You can edit a cell only if it is not a picture cell, a ring cell, or a button cell; it is not dimmed; and it is not an indicator cell. Switch from selection to edit state by double-clicking an editable cell. If the active cell (the currently selected cell) can be edited, pressing <F2> also enables the edit state. If you enable ATTR_AUTO_EDIT, the table switches to edit state automatically when you being to type into a cell. When the table is in edit mode, the active cell owns the keyboard focus, and this is the only cell you can edit.
Edit a string cell or combo box cell in the same way that you edit a text box control. Edit a numeric cell in the same way that you edit a numeric control. A numeric cell has optional up/down arrows that are visible only when you are editing the cell. You also can edit the cell by clicking these arrows.
![]() |
Note You can type multi-line text into combo box cells, but the text does not appear as multi-line in the pull-down list. |
When the table is in edit state, you can use the keyboard to change the cell that you are editing in the following ways:
To use the mouse to select a cell for editing, double-click the cell you want to edit.
![]() |
Note You cannot edit picture cells, ring cells, or button cells. |
To return the table to selection state press <Esc> or click any cell other than the cell that you are editing. If you press <Esc>, the edits you made to the cell are not retained.
If you set the size mode of a row or a column to VAL_USE_EXPLICIT_SIZE, you can size that row or column by dragging the line that separates its label from the label of the next row or column. If you configure the table to not have visible row or column labels, you can still size its rows and columns by dragging the grid lines separating the cells themselves, but these lines have a much smaller sizing area than the lines that separate the row and column labels.
If you double-click a row or column separator while you size it, the row or column automatically sizes itself to the minimum size required to accommodate the numeric values, text, or images in all its cells.
You can disable row sizing and column sizing for the entire table programmatically.
If you right-click anywhere on the table control, you activate a menu that contains predefined items, as well as items you specify.
The following context menu items are predefined:
When the table is in selection state, you can copy one or more cells to the clipboard. Press <Ctrl-C> to copy the selected cell(s). When the data appears in the system clipboard, the <Tab> ASCII character separates the data of each cell, and the linefeed ASCII character, <LF>, separates the data of each row.
LabWindows/CVI skips picture cells when it copies cells to the clipboard, with one exception: if you select a single picture cell, then its image contents are placed in the system clipboard as a bitmap. LabWindows/CVI does not copy or paste button and ring cells.
You can paste the contents of the system clipboard into a table control by pressing <Ctrl-V> after selecting the cell(s) into which you want to paste the data. LabWindows/CVI assumes that the <Tab> ASCII character separates the data that corresponds to each cell, and that the linefeed <LF> ASCII character separates the data corresponding to each row.
When the data in the clipboard includes an empty cell or cells, the paste operation makes no change to the corresponding cell (or cells) in the table that receives the new data. Similarly, when the data in the clipboard includes cells that contain data that cannot be converted to a valid number, the paste operation does not change to the corresponding cell (or cells) in the table that receives the new data.
If there is a bitmap image in the system clipboard and you want to paste it into a picture cell, select the cell and the press <Ctrl-V>.
If the control mode of the table control is hot or validate, a commit event is generated when you change the value of a cell or when you press a button cell.
The table control also generates events when the active cell changes or the selection changes.