LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

alternate row color for every other row in table


@Thys wrote:

Hmmm... asking for my grade school fees back -- clearly I have learned nothing.

 

Please look at the following VI.  I'm not selecting the row correctly for the alternate colouring.  Please rub my nose in my error!


The property you need is Active Cell.  And you need to set the Active Cell before you set the color.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 17
(1,119 Views)

Yup I discovered that.  Active Cell can take a column number or -2 for all the columns.  Trouble is "all the columns" means all the columns visible on the table widget, not the number of columns prepared for when creating the table.  I create a 3x5 table for instance, but on the front panel the table drawn is 10x10.  I'd love to create a table and display it exactly the size the user calls for. 

 

Ultimately I need to allow the user to create the table, throw some data at it, export the data, perhaps clear the table and collect more data.

0 Kudos
Message 12 of 17
(1,107 Views)

Whatcha think? 

 

Picked orange stripes because of corporate colours.  Just going to live with colours going off the end of the active page.

 

Thanks so much for your comments -- you steered me toward the solution attached.  Aren't you glad you can't be held responsible for you programming style?  😉

0 Kudos
Message 13 of 17
(1,101 Views)

Back save for 2013 and I'll happilly give you  a 5th grade math refresher


"Should be" isn't "Is" -Jay
0 Kudos
Message 14 of 17
(1,092 Views)

Improved further and made my first subVI -- tadaa!

 

The ideas is that the user clicks on a cell with the mouse, highlighting the cell.  When he is ready to take a readhing he taps a key, the meter sends a reading to the cell, the meter is reset, the cursor skips to the next cell along, un-highlighting the old cell and highlighting the new cell.  As you can see, I need the true extents of the table as set, not as is visible in the control.

 

At least the table looks pretty even if it is still useless!

 

--Thys

Download All
0 Kudos
Message 15 of 17
(1,085 Views)

Updated.  I wasn't sitting still.  ...but now there are teeth marks on the keyboard.

 

1.  The refresh button needs two clicks if the event is smouse-up.  If I change the event to vaule change, it executes twice. 

2.  The highlight trick works when the light-bulb mode is on, but only works in the top row when the lightbulb mode is off.

3.  I am refreshing the entire paint job to remove the highlight because I cannot track the last cell.  There are some scratchings on the event OldCell but it's been torn up pretty badly with testing ideas.

 

Once I can grab a cell and highlight it, I want to press the space bar to move the active cell one cell at a time down to the end of the row.  The user then selects his next starting point.

 

Thanks for taking a look at this.  Losing my mind here (not that I can afford to do much of that!)

 

--Thys

0 Kudos
Message 16 of 17
(1,066 Views)

Ok just bragging.  This looks like a pretty decent solution and I believe the code is nicer.  Feedback would be welcomed.

 

Otherwise, this VI creates a table, highlights alternate rows, places bold column and row headers, initializes the table, highlights a cell when it is clicked on, reinstates the condition in the previous cell when a new cell is clicked on.

 

I do appreciate the help I received and access to the examples all you fabulous people created.

 

--Thys

Download All
0 Kudos
Message 17 of 17
(1,039 Views)