Admin Production ni-theme
Current Publication

InsertTableColumns

LabWindows/CVI

InsertTableColumns

int InsertTableColumns (int panelHandle, int controlID, int columnIndex, int numberOfColumns, int cellType);

Purpose

Inserts new columns into a table control at the specified one-based index.

The indexes of existing columns at and beyond the specified index are increased by the number of columns inserted.

This function creates a new cell for each row in the table.

Refer to the SetTableColumnAttribute function reference for an example of how to use this and other table functions to insert cells into a table control and modify the attributes of new and existing cells.

Supported Controls

You can use InsertTableColumns with table controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
columnIndex int The one-based index into the table where the first new column is placed.

Pass –1 to insert the new columns at the end of the table.
numberOfColumns int The number of new columns to insert.
cellType int The cell type of the cells that might be created as a result of creating the new columns. The following table lists the possible cell types.

Constant Name Constant Value
VAL_CELL_NUMERIC 0
VAL_CELL_STRING 1
VAL_CELL_PICTURE 2
VAL_CELL_RING 3
VAL_CELL_COMBO_BOX 4
VAL_CELL_BUTTON 5
Pass VAL_USE_MASTER_CELL_TYPE (–1) if you want the cell types to be the default cell types for each row. Refer to ATTR_TABLE_MODE.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later

Example

Refer to userint\gridview.cws for an example of using the InsertTableColumns function.