Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with DynamicBackColor
Message
From
10/11/2020 03:13:15
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
09/11/2020 14:50:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01677077
Message ID:
01677080
Views:
79
Hi Albert,

I remember that I had problems with grids without any record and disappeared rows and DYNAMIC* stuff. For all I know a combination of grid.refresh and grid.parent.refresh after APPEND (or the like) or SET FILTER TO was the solution for me.

Lutz
>Hi,
>
>I have a grid where the user picks a "type" in the first column and then based on that, certain columns are skipped for the rest of the grid. To make it obvious, I also change the backcolor of those columns to be grey to visually signal they cannot be edited any longer. I use DynamicBackColor for this something like:
>
>grid.Column5.DynamicBackColor = "IIF(AnnuityType='Life',RGB(255,255,255),RGB(220,220,220))"
>
>- it works great 98% of the time
>- if I start with a grid populated with data, it works
>- if the user changes the type from "Life" to something else, it works
>- if I add a row to the grid (via a button), it works
>
>But it does not work if:
>
>- I start with a blank grid upon form startup and then add a row
>- for this instance, if I add a row and save the changes and reload the form, it works
>
>I don't have anything in my expression to evaluate the record number or primary key etc. that would be affected by starting the grid with no records.
>
>In the help file, it says the dynamic back color is reevaluated every time the grid is refreshed - so I force this at the bottom of my code that fires when the user changes the "type". I did not see any bug listed in the help file (the updated one) or kilo-fox. I also tried refreshing the individual columns instead of the grid as a whole and that did not help.
>
>Strange.
>
>Albert
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform