Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid color
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00184473
Message ID:
00184969
Views:
37
>>>>>I am trying to color cetain rows of a grid based on the value of a field. Where do I put the code to do this, I have tried changing the dynamicbackcolor property but this is not working.
>>>>>
>>>>You may try in to Grid.Init
>>>>This.SetAll("DynamicBackColor","IIF(mycursor.myfield=1,16777215,0)","Column")
>>>
>>>This line of code says gives an error : Invalid value for dynamicbackcolor property. Any ideas why ?
>>>
>>>This.SetAll("DynamicBackColor",'iif(sch_route.rte_pavement_type="B",rgb(255,0,0),rgb(255,255,255))',"Column")
>>
>>Ian, for some reason, columns don't like the RGB function in their dynamic properties being assigned in code. Just replace your RGB function with the numeric equivalent.
>
>Erik,
>I'm using the 'rgb()' format in DynamicBackColor without a problem, unless I want to use variables instead of numbers ( as in rgb(n1,n2,n3) ). But if you know the different colors you want, there isn't a problem with using rgb(0,0,0) in an IIF() statement here.
>
>Barbara


Barbara- I don't have a problem with it either- I have only had the problem when trying to assign these in code. The proprety sheet has always worked fine. Looking back though it was a long time ago that I had this trouble, and at the time, I oculd have been doing ther things wrongly.

Are you able to do code likethe following?

THIS.SetAll("DynamicBackColor","IIF(MyTable.MyValue, RGB(255,0,0), RGB(255,255,255))

this is what I got caught up on.
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform