Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checkbox in grid clears grid - on {Enter} only
Message
De
22/03/2010 09:22:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01456045
Message ID:
01456076
Vues:
56
Hi Naomi,

Thank's. Maybe your approach is the sounder one, although I can't offhand say why. I'll certainly give it a try.

As to the try...catch, my thinking was that, if the replace, for whatever reason, were to cause an error, I don't want the whole app to fail.

In the meantime I've narrowed the issue down: the enter on the checkbox for some reason causes the grids columncount to be set to zero. Why, I don't know.

>>I have a checkbox in a grid with this code in interactivechange method:
>>
>>TRY
>> IF THIS.VALUE = .T. AND InventoryByRequisition.TaxCredit = .T.
>> REPLACE InventoryByRequisition.TaxCredit WITH .F.
>> ENDIF
>>CATCH TO oEx
>> oEx = NULL
>>ENDTRY
>>
>>When I check / uncheck by using the mouse or the spacebar everything works fine, but pressing the Enter key clears the grid and I haven't found a way to to debug or recover from this behavior.
>>
>>There is no custom code in the when or valid section of the checkbox.
>>
>>TIA
>
>Unrelated info, but I prefer to write
>
>this.value = this.value
>
>llValue  = this.value
>
>if llValue and InventoryByRequisition.TaxCredit 
>   replace TaxCredit with .f. in InventoryByRequisition
>endif
>
>Also why do you need try/catch here - do you have triggers you expect to fail?
Peter Pirker


Whosoever shall not fall by the sword or by famine, shall fall by pestilence, so why bother shaving?

(Woody Allen)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform