Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DynamicBackColor of Each Column are different!
Message
From
20/08/1999 13:00:00
 
 
To
20/08/1999 08:23:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00255740
Message ID:
00255935
Views:
13
>>>First the expression is wrong. You must put the whole expression as a char string :
.DynamicBackColor = "IIF(Empty(myTable.Field1), rgb(0,0,0), rgb(192,192,255))"
>>
>>
>>An additional note- the Dynamic properties often don't take kindly to the RGB function in the expression, and it is often more dependable to just put the color constant as returned by RGB, rather than the RGB function. Also- try to keep all spaces out of the poperty. There is a bug in the Dynamic properties that often causes the properties to be ignored if spaces are embedded in the expression.
>
>Being honest I never faced those problems yet. I would stick to understandable RGB() till I face :) Mine always worked as long as the expressions are correct and I never counted the spaces. VFP5.
>Cetin

the RGB() problem I first noticed when setting this property programmatically in my grid class based on the contents of a RowColor property in the grid. this might have had something to do with it. The only way I could get it to work was using the literal.

The space issue is common. I think it was Paul Vlad Tatavu who narrowed down the problem a year or two ago when he noticed that the following setting would work:

THIS.Column1.DynamicBackColor="IIF(SomeField,255,0)"

but this one would cause the property to be ignored, no error, nothing:

THIS.Column1.DynamicBackColor="IIF(SomeField,255,0) "

I had run into this before but never pegged exactly waht it was. I have since seen other instances where an embedded space would cause the property to fail. I now habitually avoid all embedded spaced in Dynamic properties.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform