LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Data entry in Tables

Solved!
Go to solution

Entering data in a table cell and using the cursor keys to move from cell to cell does not generate an EVENT_COMMIT so the data is lost.  How to get the data using the cursor keys only like in Excel?

 

0 Kudos
Message 1 of 3
(3,435 Views)
Solution
Accepted by topic author JPS_CSE

The table control cannot be easily tailored to operate exactly as Excel does, but it still gives you a series of events that can facilitate getting data the user enters in it.

The very first event you must check is EDIT_MODE_STATE_CHANGE which informs you of when the table is in edit mode. After that moment, the user can move from cell to cell with tab/shift-tab (horizontal move) and Enter/shift-enter (vertical move) and you receive the ACTIVE_CELL_CHANGE event in this case. When the user types in something you receive a series of VAL_CHANGED events together with a EVENT_COMMIT event when the cell changes. Despite receiving the commit event after the cell change event, the former one reports the cell being changed in eventData parameters.

With a bit of care in coding, you should be able to handle the situation without losing any data.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(2,894 Views)

Thanks for the reply, I have also used LW/CVI from 3.1 but not as often as I'd like to.

0 Kudos
Message 3 of 3
(2,881 Views)