From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the color of a column in a table

I have to change the color of particular columns alone in a table. By using the property node and by selecting one cell at a time and then changing the color of the cell this can be done. This is bit round about way and also if the column size is not fixed this method cannot be used. In my application I have to keep the color of the cells in particular columns different from the others, which need not be varied during the runtime. Could any one suggest me some method to do that?

Thanks and Regards,
Pradeep Kumar P
0 Kudos
Message 1 of 9
(3,532 Views)
First use the Active Cell property and set the row value to -2 to change an entire column. The attached image shows how to set the background color of column 3 to green. I don't understand your comment about column size. It doesn't matter how wide or narrow a column is. Using the Cell Background Color property, the entire cell is colored. If you are having difficulty keeping track of the number of columns, thats a different issue.
Message 2 of 9
(3,531 Views)
You can programatically change the column color, the logic you use will depend on your vi architecture. The attached vi (based on Setting Table Cell Colors Programmatically
) provides a method, all you need to the is keep your column value constant (statically and dynamically).
0 Kudos
Message 3 of 9
(3,531 Views)
coimbatore wrote in message news:<5065000000080000000F720000-1042324653000@exchange.ni.com>...
> I have to change the color of particular columns alone in a table. By

Make the Table cells transparent, and put the color behind each
column. You may do this statically with a colored decoration, or
dynamically with a boolean or a color box. The dynamic approach is
preferred if you are going to be altering column sizes during runtime,
as you may then scale the widths of the colored areas accordingly.
0 Kudos
Message 4 of 9
(3,532 Views)
> I have to change the color of particular columns alone in a table. By
> using the property node and by selecting one cell at a time and then
> changing the color of the cell this can be done.

I don't think anyone has mentioned the special values for Active Cell.
I believe setting the Active Row to -1 and Active Column to 2 will set
the header of column 2. Setting Active Row to -2 will make the entire
column 2 active, and any attribute setting, such as color will be
applied to all cells in the column automatically.

This lets you treat the columns as a whole and should vastly simplyfy
things.

Greg McKaskle
Message 5 of 9
(3,531 Views)
This is a good informaton. Please where can one get additional information about it?
0 Kudos
Message 6 of 9
(3,531 Views)
Nice approach Mr. Greq.
0 Kudos
Message 7 of 9
(3,531 Views)
How do you make the table cells transparent?
0 Kudos
Message 8 of 9
(3,455 Views)
Looks like to make table cells transparent you have to run the VI at least once with the CellBGColor property. Wire the color constant into it (can be found in the numeric palette) and select the color to be T (top right). You also need to select the active cell.
You may also need to click to select the paintbrush, right click one of the cells and select T there.
Does anyone know why this is so? Why does selecting T with the paintbrush not turn the cells transparent (at least in 7.0)?

___________________
Try to take over the world!
0 Kudos
Message 9 of 9
(3,444 Views)