Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Make sure the last change is taken in the grid
Message
From
22/03/2013 04:52:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01568982
Message ID:
01569000
Views:
45
>Hi everybody,
>
>In the grid control I edit the value in one of the cells and then press the button on the form (the grid itself is in the container and that container is on the pageframe).
>
>If I click on that Save button without doing any other grid movements first, that newly added value is not saved and the grid doesn't know the value was changed.
>
>What is the best way to handle the situation? Bind grid's textboxes InteractiveChange to grid's method to indicate the change was made?

Move the action code from button.click() to button.when() and return .f. from it. This means the button doesn't gain focus.... um, no, that was the trick for something else. For this, you need to force validation on the grid. To do that, you need a change of focus - even to the same object would do. Try .grid.activecell.setfocus() or .grid.setfocus(), whichever of these is an object you can reference and set focus to. This would force the focus to be initially lost to the grid's cell, which would trigger validation, which forces the control.value to be written into the controlsource.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform