Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Make sure the last change is taken in the grid
Message
 
 
À
22/03/2013 04:52:39
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01568982
Message ID:
01569017
Vues:
46
>>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.

I seem to solve the problem yesterday using my original idea of binding InteractiveChange to container's InteractiveChange. At least now that form works as it should.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform