Showing results for 
Search instead for 
Did you mean: 

About Array Click Event

Go to solution

Can I click Array to get the data and index of that location?

I uploaded a picture!

0 Kudos
Message 1 of 9
Accepted by topic author adavb

Yes, but not easily.


You have the coordinates of the button click at the left edge of the Event Structure there. Together with a collection of Property Nodes to get the position of the array, the width and height of the elements, and some knowledge of the spacing (depends, if I recall correctly, on the indicator type (Modern, System, etc)) you can calculate the element index.


From the index, you only need Index Array to get the data value (you can get the array value from the Ctrl Ref if that pink wire to the left is not the current data values).


Edit: Actually, if the array is selectable, then the Array Element > Value property node will give you the value of the element. In that case, the Index is more difficult to find, but do you need that (or only to get the value?)

Example_VI.pngThis would work with Strings too (change the Variant to Data type) but DBLs are easier to generate for testing


IndexVals is read here because I suspect that might also be relevant to getting the index of the selected element (since the click is relative to the visible elements, not the 0,0 element (imagine you already scrolled down the array etc).

0 Kudos
Message 2 of 9

Start reading here. 😄

LabVIEW Champion. It all comes together in GCentral GCentral
Message 3 of 9

Thanks ! 

I solved this problem with your help

You r my Hero!!


0 Kudos
Message 4 of 9

Since you are using strings consider using a table instead of an array.


A table has a method "Point to Row Column" that will return the index as well as a Boolean if the click was in the bounds of the table.



Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 9

Hi guys..


1.I want to get Row's values in a two-dimensional array when clicked.
What kind of ways are there?

2. Is there a way to get an Index of the click of a two-dimensional array?


plz help me

0 Kudos
Message 6 of 9

Hi adavb,


I have a problem …

We have a problem when you create new threads for the same (old) topic…


What's wrong with the suggestions you already got?

And why don't you use AutoCleanup before posting code images?

Best regards,
CLAD expired, using LV2011SP1 + LV2017 (+LV2019 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 7 of 9

I didn't understand what you were saying.
What does Old Topic mean?

0 Kudos
Message 8 of 9

On August 19, you created a topic called "About Array Click Event".  That is the "old" topic.

Because on August 26, today, you created a new topic called "I have a problem aboud (sic) Array get rows" although it was about the same question.


Someone merged the two threads into one.


0 Kudos
Message 9 of 9