LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting colors of specific cells in NXG Data Grid

I would like to set the background color of specific cells based on their value in a data grid in a NXG WebVI. I suspect that I will need to use style sheets to accomplish this. I was wondering if anyone had an example of doing this. the cell contents are limited to a small list of specific values, but based on the value I would like to color the background of the cell to highlight it. For example, one column may have a st of values such as "Online", Offline" and "Standby". I would like to color the cell red if it is offline, green if it is online and white if it is in standby.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 1 of 6
(2,991 Views)

Hey Mark

 

Have you taken a look at the WebVI examples on github? there are a couple that use CSS/stylesheets to edit "stock" controls.

 

https://ni.github.io/webvi-examples/

https://github.com/ni/webvi-examples

 

Cheers

 

Jono

0 Kudos
Message 2 of 6
(2,909 Views)

Hi Mark, 

 

Have you found solution to this problem? 

I am also looking into the same feature in nxg web vi.

Thanks & Regards,
Irfan
(CLD)
https://haliatech.com/
0 Kudos
Message 3 of 6
(2,778 Views)

No, I have not found a method yet. Though I haven't looked at it extensively since other items were getting my attention.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 6
(2,758 Views)

I've the same issue,

any one any idea?

0 Kudos
Message 5 of 6
(2,216 Views)

I created an example library called Declarative Style for WebVI that can help with the use case of changing the styles of cells in a data grid based on the text of the cell.

 

The following is an example of what the diagram looks like using the library:

fulldatagridstyleexample.PNG

 

And the following shows the result running in the browser:

datagridstylerunning.PNG


Milan
Message 6 of 6
(2,075 Views)