LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a table for selection only?

Currently I am using CVI to create a User Intferface that use table for user select some item (as I cannnot find multi-column listbox as in LabVIEW). I would like to disable user from editing those cells while I cannot do so by setting the following attribute of the table:

SetCtrlAttribute(A_PANEL, A_PANEL_TABLE, ATTR_SHOWN_BELOW, VALUE_SHOWN_BELOW);

1. ATTR_TABLE_RUN_STATE VAL_SELECT_STATE
2. ATTR_NO_EDIT_TEXT TRUE

Could you help me for this problem?
0 Kudos
Message 1 of 2
(3,548 Views)
The attribute you're looking for is ATTR_CELL_MODE, which you should set to VAL_INDICATOR.

You need to set this attribute on the cells, not in the control. The function you use to set an attribute on a range of cells is SetTableCellRangeAttribute. If you want to set it for all the cells in a table, pass VAL_ENTIRE_OBJECT as the range.

If your application creates a lot of rows, you can avoid having to keep setting this attribute in the new cells by setting once for the column. Just call SetTableColumnAttribute for each column you want to set (-1 for all columns) and all new cells in that column should have this attribute set by default.

You can also configure all this in the UI editor, if you prefer.

Luis
NI
Message 2 of 2
(3,548 Views)