From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-20-2010 07:10 AM
04-20-2010 07:32 AM
Supposing column properties are not changing at runtime from the default, simply adding a row with
InsertTableRows (..., ..., ..., ..., VAL_USE_MASTER_CELL_TYPE);
automatically creates a new row with default settings for every column. For this to work, the table must be set incolumn mode either programmatically or in the UIR editor.
As per copying values from a row to another, you could use clipboard functions for table as described in this thread.
04-20-2010 09:10 AM
04-20-2010 12:03 PM
Norbert,
Roberto's method allows you to create your new cells with the cell attributes that you have defined for each column. Once you define these attributes by configuring each column in the UI Editor (Edit Table>>Edit Column>>Edit Default Cell Values), you can ensure that each new cell created under that column inherits those attributes. By attributes, I'm referring to items such as the cell type, or the text style.
Sadly, however, you can't inherit the cell values themselves.
One thing you could do is to go ahead and create the new cells and then use the functions ClipboardGetTableVals and ClipboardPutTableVals to copy the values from the first row to the new row. However, you will still have a problem with your ring cells, since the entire list of items that each ring cell holds is not considered an attribute (therefore, you can't define it ahead of time in the column) but it also is not copied to the clipboard. Only the current value is copied, I believe. So you'll have to recreate this list for new ring cells each time.
I'm sorry that this isn't as easy as it should be...
Luis
04-21-2010 06:40 AM
04-21-2010 08:24 AM
Norbert, are you sure you formatted the column (Edit table >> Choose column >> Edit column >> Edit default cell values) and not individual cells in the first row (Edit table >> Select a cell>> Edit cell in the lower right corner of the panel)?
If you edit the column default values they automatically reflecs on new cells. If you are editing the column defaults after creating the first row, when you terminate the function CVI will ask you"Would you like to apply those changes to the existing cell(s) of this column?".
Anyway, InsertTableRows acts exactly as the Insert Row button in table edit panel: if adding a new row maintains the attributes you have correctly set column defaults, otherways you haven't: it can be tested just to be sure the application will work correctly at runtime.
04-22-2010 03:10 AM
04-22-2010 11:55 AM
Hi Norbert,
I realize that by now you have already worked around this problem, but it's still bothering me a bit that this didn't work for you. I'm wondering if there might some bug in CVI that's causing this.
If you still have your .uir, how do you feel about sending it to me, so that I could investigate further? You could attach it here in a post, or if you'd rather not have it out in public, you could upload it to our secure ftp site.
Luis
NI
04-23-2010 06:10 AM