03-17-2011 08:18 AM
In one version of LV with 64K in the list box, it made difference.
Ben
03-17-2011 08:24 AM
Believe me, I would love to find a funky workaround for this one 😉
11-11-2011 04:53 PM
How do you set the entire row to a background color? I've got an event (in an event structure) that is active when you double click on a row, I use the "Point to Row Column" property to identify the cell position of the cell clicked, then I use the MCListbox> Active cell to set that cell to be active then I set the cellBG to the color I desire.
I have several problems with this. (1) I want the entire row to be highlighted not just the cell. and (2) when new items are added to the list box, the colored cell stays the same and doesn't move down with the associated data. For example if I double click on the 3rd cell down to highlight it, after I add more data to the list box, the 3rd cell always is highlighted and doesn't move down with the specific data I wanted highlighted.
Any help?
11-14-2011 04:17 PM
Let me try to re-iterate your problem so that I am sure I understand what you are asking.
1.) During execution you double click on one cell in the listbox and are able to change that cell to a different color. You also want to change the background color of every cell.
- Use a for loop to cycle through every element in the one particular row and change the each color.
2.) During execution you dynamically add more data to the list, but the colors do not follow. You would like the same data, not the same row, to remain highlighted. I will assume you only want one row highlighted at a time.
- Use a shift register to keep track of which row is the colored row. When you add a new row, check to see if the row is above or below your colored row. If the new row is below, do nothing. If the new row is above, first color the background of the old row to white, then paint the new location a different color.
Let us know if this works!
Ryan
Applications Engineer
National Instruments
ni.com/support
11-14-2011 04:23 PM
HI - thanks for the tip on using a for loop to cycle through all of the cells in a row to highlight them too.
for (2) your understanding is correct, however, I need multiple rows of data to be highlighted at the same time.
11-14-2011 06:44 PM
In that case, I would expand upon the idea. The output from the Multilist indicator is an array of the selected rows, so I instead of keeping track of the previous selected column, keep track of the array. Then in your event handler for the input row even, have another for-loop that will check each entry to see if it is above or below the new entry, and then color and un-color appropriately.
Depending on how many rows you have selected and how many columns each row has, it may be advantageous to check and see if any row is already colored, so that you do not need to un-color and re-color. I would get the basic implementation working first, and then if you find it to be to slow, then focus on optimizing your implementation.
Let us know how it goes!
Ryan
Applications Engineering
National Instruments
ni.com/support
11-15-2011 01:47 AM
Three additional points:
02-18-2023 10:10 AM
Not sure if anyone will see this...but it really blows my mind that there isn't a direct way to just set an individual cell color with a row/column input and thats it.
02-18-2023 11:14 AM - edited 02-18-2023 11:14 AM
Hi Coastal,
@CoastalLabVIEWER wrote:
Not sure if anyone will see this...but it really blows my mind that there isn't a direct way to just set an individual cell color with a row/column input and thats it.
It seems you miss the properties of a MCL:
Just select the ActiveCell (which needs row & column), then set its color!
02-18-2023 11:59 PM
And if you want something that "sets it and that's it", then you can turn the code into a subVI. The documentation for the property node doesn't say if all of its properties are executed atomically, so you should probably assume that they aren't and make sure no other code works on the active cell at the same time.