LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does the active cell position doesnot change when I select different cells in a table?

Solved!
Go to solution

Just as the title says, I am not sure why the indicators are showing fixed values no matter which cell I select in the table. Any help is much appreciated. Thanks

0 Kudos
Message 1 of 10
(1,670 Views)

Save your VI for a previous version (at least 20) so we can open it, not many people have the 22.3 version installed.

Lucian
CLA
0 Kudos
Message 2 of 10
(1,652 Views)

Sorry about that. Please find the vi as below

0 Kudos
Message 3 of 10
(1,640 Views)
Solution
Accepted by topic author kevinks

Your indicators are displaying 3 values that aren't changing:

  1. Position is the position of the control on the front panel
  2. Active Cell is the cell which is referenced when cell properties are accessed.
  3. Active Cell Position is the position of the active cell on the front panel.

The active cell is affected by writing to that property, not by clicking on the table.

Use an Invoke node to point to the row, column.

 

Also, your timeout case is pointless.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 4 of 10
(1,604 Views)

@kevinks wrote:

Just as the title says, I am not sure why the indicators are showing fixed values no matter which cell I select in the table. Any help is much appreciated. Thanks


Instead of getting stuck in the mud, I assume that your real question is how to get the cell indices when clicking on a table.

 

Try this:

 

altenbach_0-1662943284772.png

 

you can e.g. use the cell position output to index into the table array to get the value.

 

0 Kudos
Message 5 of 10
(1,593 Views)

Sorry for being vague on the topic. I didn't need the cell row and column number but instead the exact coordinates of the cell so that I can push another ring control whenever the user clicked on the cell. Will that be possible?

0 Kudos
Message 6 of 10
(1,545 Views)

The event data node as shown gives you the coordinates of the mouse click. You can use it for anything you like.

0 Kudos
Message 7 of 10
(1,537 Views)
Solution
Accepted by topic author kevinks

@kevinks wrote:

Sorry for being vague on the topic. I didn't need the cell row and column number but instead the exact coordinates of the cell so that I can push another ring control whenever the user clicked on the cell. Will that be possible?


Yes.  I did that before.

In mouse down/down? case, use point to cell to find the row & column.  Use that to make the cell the active cell.

Get the position and size of the active cell, resize your ring, move it the active cell position, make your ring visible.

After user made their choice, set the value of the active cell to user's choice.  Hide the ring.

The ring looks just like part of the table.  User won't be able to tell the difference.

 

George Zou
0 Kudos
Message 8 of 10
(1,505 Views)

@zou wrote:

@kevinks wrote:

Sorry for being vague on the topic. I didn't need the cell row and column number but instead the exact coordinates of the cell so that I can push another ring control whenever the user clicked on the cell. Will that be possible?


Yes.  I did that before.

In mouse down/down? case, use point to cell to find the row & column.  Use that to make the cell the active cell.

Get the position and size of the active cell, resize your ring, move it the active cell position, make your ring visible.

After user made their choice, set the value of the active cell to user's choice.  Hide the ring.

The ring looks just like part of the table.  User won't be able to tell the difference.

 


For that you again need the cell coordinates (as I showed) and not really the mouse coordinates. Obviously, the problem description is not very clear. 😄

0 Kudos
Message 9 of 10
(1,492 Views)

@paul_cardinale wrote:

The active cell is affected by writing to that property, not by clicking on the table.

Use an Invoke node to point to the row, column.


Yep, I get it now. Thank you

0 Kudos
Message 10 of 10
(1,462 Views)