LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read 2D data, select row, then add/modify content to a specific cell?

Solved!
Go to solution

Hello,

 

I have a simple VI that loads data from a spreadsheet file (in my example it is just a 2D array with some data in it). I want to be able to select a row and add/modify 'notes' (the last column of the listbox). Additionally, when I select any row that already has data in that last column, the program should display that data in the 'notes' string field in such a way that I can edit the notes.

 

I just cant seem to be able to figure out how to enable both a read and write from the same String control...

 

Thanks!

-amproctor

0 Kudos
Message 1 of 15
(3,466 Views)

Can you post your code in LV 2009?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 15
(3,456 Views)

2009 Version Attached.

0 Kudos
Message 3 of 15
(3,441 Views)
Solution
Accepted by topic author amproctor

Here ya go

 

There may be a better way but this works. You need to use the items property of the listbox. Also, using an event structure could make this cleaner

 

 

Edit: Just noticed you can't edit the Notes column in the listbox. Right click the list box and choose "Editable Items". This will allow you to then edit the items. But, my example doesn't work for that so you will need to slightly modify it if you want this capability also.

Download All
Message 4 of 15
(3,433 Views)

Thanks!

0 Kudos
Message 5 of 15
(3,423 Views)

See my "Edit" in above post.

0 Kudos
Message 6 of 15
(3,418 Views)

Correct and non-abusive use of both a sequence structure AND a local variable!
Didn't think I'd live to see the day... Smiley Very Happy

Cory K
Message 7 of 15
(3,413 Views)

Thanks again, I do not actually want to be able to edit the cell in the listbox, only from the string input window...

0 Kudos
Message 8 of 15
(3,412 Views)

@cory K wrote:

Correct and non-abusive use of both a sequence structure AND a local variable!
Didn't think I'd live to see the day... Smiley Very Happy


I put the comment in the code about that to avoid the proverbial metaphorical choke slams from other LabVIEW programmers Smiley Very Happy

0 Kudos
Message 9 of 15
(3,403 Views)

You should really structure the program a bit better using an event structure.

 

Right now everything is muddied together and you constantly operate on things even if nothing has changed.

 

  • If something is entered in the notes box, update the 12th field at the current position
  • If the listbox changes, fill the notes field with the new value.
I also limited the notes to a single line, this way you can complete the update with <enter>.

 

 

Here's a quick draft. modify as needed.

Download All
Message 10 of 15
(3,389 Views)