LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to shift old colored cells downward unlike string cells in the multicolumn listbox when adding new cells

Hi I would like to shift the old colored cells downward for the new added colored cells, just like for string cells in the multicolumn list box.
I cannot figure it out. How do I move a row of old colored cells downward for each first new loop?

Pls see my attached (labview 7.1).

Is that all the multicolumn list box can do except shifting the colored cells?

Pls advise I would appreciate  your help.
Clement
Message 1 of 8
(3,686 Views)

Hi Clement,

i think you have to set the new backgroundcolor for each element with adding a new one on top.

Mike

0 Kudos
Message 2 of 8
(3,677 Views)

Hi Clement,

Can you attach the missing sub VI?

- Partha ( CLD until Oct 2027 🙂 )
Message 3 of 8
(3,675 Views)
Hi Partham, Sorry for the missing.
Actually It just rounds off to 2 decimal points.
So you can either remove and rewire it to next block or you can get my attached vi.
 I dun think any  NI multi column box functions have support for shifting  the values together with colored cells.
Thanks

Hi Mike
I have populated all the values and then colored cells in the first loop. and then do the same thing for second loop.
Am I doing the right thing? Do you mean that I should coloured each cell at the same time as the value inserted?

Clement

0 Kudos
Message 4 of 8
(3,653 Views)
I am not sure if you are asking why your code doesn't work, or if you want the colors to scroll down.  I went under the assumption you wanted your VI to work.

Your VI stopped at 8 lines because you were only using the counter from your internal loop.  So, after 8 iterations, the counter would reset to 0.  So you would set the row colors from 0-8 three times.  So, you need to calulcate which row you are on to properly set the row.

Also, I made use of multiple selections for setting the Active cell.  Active Cell has meanings for -1 and -2.  -1 selects the row headers or column headers.  -2 selects all rows or columns (including the headers).  So, you can set the color of all cells in the listbox at once by setting the Active Cell to -2,-2.  This also changes the column header color.  So you will see I follow that by setting Active Cell to -1,-2 to select the column header (row -1) for all columns.  I set it back to grey.

Using these methods is dramatically faster and if you use Defer Front Panel Updates before changing the colors, it will go even faster.
Message 5 of 8
(3,644 Views)
I also should add that your round VI is not necessary if you are going to convert it to a string.  Specifying 2 decimal places in the convert to string will only display 2 decimal places regardless of how many are coming in.
0 Kudos
Message 6 of 8
(3,632 Views)
Hi Matthew. Thank you very much!

I will study how your code works. However, come to think, my code does not work correctly. May be I will do it in the different way,
What I was thinking is that, in the next working program,  I would want each loop to accept a 1D array of values and a 2D array of min and max values, then do comparisions.
Then a 1D array of evaluated values are produced with colours for each value and first row in the table is filled with evaluated values and colored cells. In the next loop, it performs the same thing, except, add a new row for second loop, pushing the first row of values and colored cells downward for second row to be inserted. Therefore the first row's data with colour is retained. Is it possibe?
We can do that with values, but not coloured cells. I will study your code then come up with the plan.
Anyway thanks.
Clement
0 Kudos
Message 7 of 8
(3,600 Views)
Hi again. Forgot to add
Just want to say that colored cells will be decided based on the evaluation values, ie  green means within  bandwidth and red means  not within bandwidth,
That's all I have to add.
 Thanks

0 Kudos
Message 8 of 8
(3,594 Views)