Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Change grid row forecolor to red/different
Message
De
14/03/2019 09:50:09
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/03/2019 08:10:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
01667199
Message ID:
01667219
Vues:
86
J'aime (2)
>Does this affect performance and how?

Depends on how complicated the expression is. If it's some simple thing like iif(expr, value, value), then no problem. However if it the expression is "thisform.CalculateColor(alias.field)" and there are 50 lines of code in that method, then... well, last time I saw that was in VFP6 on a 200MHz machine, where it did slow down a bit and became near impossible to wait out in the debugger.
The trick to avoid that is not to avoid calculation, but to avoid repeating it so many times. Because all dynamic column properties get evaluated on each refresh for each visible cell. So store the result in an extra field in that same cursor, and use that field as the dynamic color expression. Recalculate when there's a change in fields involved.
IOW, replace nForeColor with thisform.calculatecolor(alias.field) somewhere in grid's .valid() perhaps, and dynamicforecolor="alias.nForeColor". The speedup back then was immesurable - it went from sluggish to too fast to notice.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform