Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Change grid row forecolor to red/different
Message
From
14/03/2019 09:50:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
14/03/2019 08:10:14
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
01667199
Message ID:
01667219
Views:
84
Likes (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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform