LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Color code table (optimization)

I want to be able to color code a large table. it takes a very long time to do this. i assume it takes a lot of time because each change in color generates a paint event. i am trying to avoid the same by one of the following approaches
1) hide the table, update colors and show table
2) disable front panel updating of the vi and updte the table and enable front panel updating

Neither of the approches give me much performance gain. is there a way to make it faster?
0 Kudos
Message 1 of 3
(2,992 Views)
Hi Anand

I am surprised that "Defer Panel Update" is not speeding the process for you.
I also have to update large table cell color, and "Defer Panel Update" does make a difference. One think to note, if your table is in a Subpanel, it seem that "Defer Panel Update" does NOT work in subpanel (LV7.0, have not tested in LV7.1)

Another trick that I used (and it is not mentionend in the table help but in the multi column list box help) is that you can paint full rows (or cols) in one single shot (of course if you do not have rows/cols of the same color, it is not very usefull).
Here is a snapshot of the multi column list box help

Active Cell Property
Property of MulticolumnListbox.

"Sets the row and column of the cell(s) to which you want to apply
subsequent property changes. The following table lists example values for this property.

Row Column Result
�2 0 Selects all cells in the first column, including the column header.
�2 �2 Selects all rows and columns, including column headers.
�1 0 Selects the header of the first column.
�1 �2 Selects the headers of all columns.
0 �2 Selects all cells of the first row, including the row header.
0 �1 Selects the header of the first row."

Hope it help.

PJM


  


vipm.io | jki.net

Message 2 of 3
(2,992 Views)
Thanks a lot! My requirement is to paint one row using the same color. so selecting row,-1 dramatically improves the performance.

Anand.
0 Kudos
Message 3 of 3
(2,992 Views)