LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multicolumn listbox

Solved!
Go to solution

I need an object to store lab-measurements and are wondering, if it’s possible to use a multicolumn listbox.

My problem is that, I need to know the row number of the active row. By ‘the active row’, I understand the row belonging to the cell activate by user scroll using arrows/ or mouse click.

 

Background for my question:

I want to store the sample number I the first column. The sample numbers are imported from Excel.

The measurements for the actual sample should come in, in the cells to right in the same row.

 

The samples are not always ordered, which means, that I might need to scroll to the correct sample number.

In order to place the output from the measurement coming from my labView program, I need to know what is the row number of the activate row. But how ?

 

Is it possible using multicolumn listbox, or is there another object, which can do the trick?

In c# it’s possible to do as described using datagridview.

0 Kudos
Message 1 of 18
(5,391 Views)

Hello!

Use event structure and multicolum listbox. For example set event to trigger for double click, and at right side border you'll be able to read number of row that was choosen. 

Then read data from first column and selected row. 

0 Kudos
Message 2 of 18
(5,365 Views)

Great !!!!

Thanks a lot!
I was thinking a little in that direction, but I'm new in labview.

Regards Michael

 

0 Kudos
Message 3 of 18
(5,356 Views)

Glad I could help. If you'd need any more help don't hesitate to ask;)

BTW: if post is a solution, you can mark it as one;)

0 Kudos
Message 4 of 18
(5,347 Views)

I just tested  your solution.

I new as I mentioned and don't recognize the object after the itemNames.

What is that ?

0 Kudos
Message 5 of 18
(5,317 Views)

@mkoppelgaard wrote:

I just tested  your solution.

I new as I mentioned and don't recognize the object after the itemNames.

What is that ?


"Index array"

0 Kudos
Message 6 of 18
(5,309 Views)

I'm afraid I need a little more help.Smiley Sad

I tried myself - see attached.

Could I have you example?

 

And is dobble click the only way to get the activecell row?

Is i possible to get the active row simply by running at piece of code in the end off my "producing my data" code?

 

0 Kudos
Message 7 of 18
(5,291 Views)
  • You don't need the control reference, since you use an implicit property node.
  • The ItemNames property needs to be set to "read" mode. (right-click...change to read)
  • You can use a value change event so the item is displayed whenever you click once.
  • You need a while loop around the event structure

 

0 Kudos
Message 8 of 18
(5,275 Views)
Solution
Accepted by topic author mkoppelgaard

I have added some code to your VI.

  • The event structure needs to be i a loop, otherwise your program will stop after the first double click
  • You need to initialize the array before you start replacing elements, because it is not possible to replace non existing elements
  • The Top Left property of the list box can be used to determine the index of the top left visible cell of the list box
  • I used now the double click as trigger to change the content of a cell, but you could use a user generated event instead, an fire this event each time a new measurement is available.
0 Kudos
Message 9 of 18
(5,270 Views)

Thanks - got it now Smiley Very Happy

 

I take it, I can't get out which cell I'm in without using event.

I can't run my datacollection code,  and put in the data in the the selected row, without having to dobbelt click on a cell in the row or changing a value in the row.

The only way to let Labview to know which cell I'm in is to dobbeltclikk or to change value? Correct?

0 Kudos
Message 10 of 18
(5,253 Views)