LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot replicate the ring cells' value list on a table

Hi, 

I am trying to create a variable-size table/matrix of ring cells. The default value list is "0 (x)" and "1(P)", for binary purpose, specified in cell (1,1). When I insert a new row and/or colum on the table, It looks like the inserted cells does not inherit the specified value list "0 (x)" and "1(P)" from cell (1,1).

 

I have also tried the following options, but none of them works.

(1) change the Table Mode (Edit Table -> Control Settings -> Table Mode) to either "row" or "column" from "grid"

(2) use the parameter "VAL_USE_MASTER_CELL_TYPE" instead of ring type

(3) search the forum but not clue found

 

Please also see the attached snapshot files, which show how the settings are set.

(1) "snapshots_02_ring_list.jgp": specify the ring value list of cell(1,1)

 

(2) "snapshots_03_edit_default_cell_values.jpg": I tried also to specify the default cell values in Control Settings (Edit Table -> Control Settings -> Edit Default Cell Values -> Ring/Combo Box Attributes), but the button "Value List" is greyed out.

 

(3) "snapshot_04_cells.jpg": the created/inserted cells do not have the value lists

 

Here is the code piece for your information:

// insert a few rows

InsertTableRows(panel,PANEL_TABLE_CHKBRD, (iNumOfRowNow+1),iNumOfRowChange, VAL_USE_MASTER_CELL_TYPE);

// draw the cells

ProcessDrawEvents();
// set the active row
SetCtrlAttribute(panel, PANEL_TABLE_CHKBRD,ATTR_FIRST_VISIBLE_ROW, iNumOfRowNew);

 

Thanks.

0 Kudos
Message 1 of 5
(4,537 Views)

I am not an expert with tables but I would assume that only attributes of new cells can be inherited (i.e. everything that you can change on the panel 'Edit Default Cell Values', e.g. the Show Pull-Down Arrow, or any attribute that you can set using SetTableCellAttribute) - not the values of individual cells.

0 Kudos
Message 2 of 5
(4,531 Views)

Thanks for your info.

 

The major problem here is that the ring pull-down menu has been inherited, but the ontents (Value List) of the pull-down menu is blank.

 

How can we replicate the pull-down menu as well as the Value List?

0 Kudos
Message 3 of 5
(4,529 Views)

If my assumption above is correct then I guess one has to populate the rings oneself. If there is only one item it will be the selected ring item and then you can simply use GetCtrlVal and SetCtrlVal. If you want to clone longer rings you will need to loop through all indices (see here for relevant commands)

0 Kudos
Message 4 of 5
(4,526 Views)

You cannot inherit the ring values of a cell. This is why the Value List button is dimmed when you edit the default cell values of a column in the UI Editor.

 

You can use the InsertTableCellRingItem function to programmatically create the value list of any new cells that you add to the table. Or the InsertTableCellRangeRingItem function, if you want to do the same thing for multiple cells at once.

 

By the way, for items that can be inherited (i.e. cell attributes, as Wolfgang put it), inheritance does not happen from one cell to another. Depending on the table mode, inheritance happens from a column's default cell to new cells under that column, or from a row's default cell to new cells on that row, or from the table's default cell to all new cells.

 

Luis

0 Kudos
Message 5 of 5
(4,486 Views)