LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set key focus of a table cell?

I have a table control in Labview 7.0 that has text in it. I want to set the current cell to a specific cell so that the user can simply type a value and it begins editing that cell. I have set the edit position, active cell, selection to the cell I want, and have set KeyFocus to True. The cell is highlighted and the text within it is highlighted, however, the user still has to click on the cell before his typing will affect the cell. How do I avoid this click?
0 Kudos
Message 1 of 13
(5,497 Views)
Hi Kirk,

Please see the attached VI that sets the key focus for a table control. User would not need to click on the table cell.

Please let me know if you have more questions in this regard.

Regards,
Ankita A.
National Instruments
Message 2 of 13
(5,493 Views)
Thanks that fixed it! I couldn't find documentation of that feature.
0 Kudos
Message 3 of 13
(5,493 Views)
Is there a way to get this work with Labview 6.1? I tried opening the VI control but got the error message "error code 9: VI version (7.0) is newer than LabView version (6.1)".



John Bessire
0 Kudos
Message 4 of 13
(5,420 Views)

@JohnB10000 wrote:
Is there a way to get this work with Labview 6.1?

John,
I think it's just a matter of setting a property node for the table with KeyFocus=True and EditPosition=[row,col] of interest (in that order). You don't need to use an event case as in the attached; it's just something I had sitting around.
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 5 of 13
(5,391 Views)
Donald,

Your VI works great and thanks for the help.

I am also trying to do the same thing in LabWindows/CVI so the cell will be ready to edit as soon as the panel loads. So far I got the cell highlighted but the user still has to click on a cell. The tab stops are set so the table gets the focus as soon as the panel loads.

SetCtrlAttribute (sysinfo, SYSINFO_TABLE, ATTR_TABLE_RUN_STATE, VAL_EDIT_STATE);
SetActiveTableCell (sysinfo, SYSINFO_TABLE, activeCell);



John Bessire
0 Kudos
Message 6 of 13
(5,379 Views)
Hi JohnB10000,

For the best results, please repost your question in the LabWindows/CVI Forum, thanks.
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 7 of 13
(5,371 Views)

How or where did you locate/create the 'Old Edit Position' property of this property node?  I opened your example vi and was unable to determine/select this property myself. ;-(

0 Kudos
Message 8 of 13
(4,695 Views)

"How or where did you locate/create the 'Old Edit Position' property of this property node?  I opened your example vi and was unable to determine/select this property myself"

 

Hi Newton2this,

 

It's from 2005 and thus is an old VI from an old version (6.1, ~2001) of LabVIEW.  Back in those days the property was just plain 'EditPos'.  Now, it's probably changed in name to something else which does seven times as much, will never cause a memory leak and it probably drives a red Ferrari.

Old stuff just breaks down sometimes and is beyond repair.

 

Sincerely,

 

Old Donald

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 9 of 13
(4,688 Views)

Alright.  Thank you Donald.  I kind of suspected the problem was version specific.  I am running LV2011.

0 Kudos
Message 10 of 13
(4,682 Views)