Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox in grid column.... When is cursor updated?
Message
From
25/09/2017 10:45:25
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Textbox in grid column.... When is cursor updated?
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01654540
Message ID:
01654540
Views:
87
Textbox in grid column question.... When is the value entered in a textbox in a grid column applied to the underlying bound cursor relative to the firing of the grid.AfterRowColChange() when user hits tab to move to the next column?

Here is the situation I am struggling to understand: When entering a new value in a column and then hitting tab to go to the next column, it appears that the value from the textbox which you are exiting is not applied to the cursor yet at the time AfterRowColChange() fires. I have some calculation logic on AfterRowColChange() and the old value is what I am seeing.

As a hack, I have gone this route, but I hate it: In order to get the value from the textbox in the cursor soon enough to be seen by the AfterRowColChange() method code, I have put explicit code in the textbox.Valid() to say “Replace {field} with This.Value in {lcCursor}” and then the cursor is updated so that when AfterRowColChange() is called, it will see the new value in the row for that field.


** UPDATE **

I have confirmed that if I use the down arrow to exit the textbox and move to the next *row* in the grid, the calculations in AfterRowColChange() work perfectly, so that shows that the value from the textbox is applied to the cursor beforehand when changing rows. But, when moving horizontally from one column to another, I have to move *2* columns before the calculations based on the underlying cursor work properly.

.
Next
Reply
Map
View

Click here to load this message in the networking platform