Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing row colour of grid based on condition
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01531331
Message ID:
01531350
Views:
34
>>>>Sorry I want the forecolor only to change
>>>
>>>You can put condition for DynamicForeColor in grid's Init, e.g.
>>>
>>>thisform.myGrid.SetAll('DynamicForeColor', 'iif(inlist(Service,"STANDARD","..etc."), rgb(...), rgb(...))','Column')
>>>
>>>You can also create condition separately using TEXT ENDTEXT, e.g.
>>>
>>>text to lcCondition noshow
>>>   IIF(INLIST(Service, 'STANDARD', ..),rbg(..), rgb(..))
>>>ENDTEXT
>>>
>>>and use lcCondition inside the SetAll method.
>>
>>Naomi
>>
>>I think I see what you mean but I'm not sure
>>
>>Any chance you could give me the complete code
>>
>>Thanks
>>
>>Colin
>
>Form's Init (although you can also use Grid's Init):
>
>local lcCond
>text to lcCond noshow
>  IIF(INLIST(TableAlias.Service,'STANDARD', 'ECONOMY SERVICE','STANDARD (EXPRESS)','ECONOMY'), rgb(255,0,0),rgb(0,0,0))
>ENDTEXT
>
>thisform.grdMyGridName.SetAll('DynamicForeColor',m.lcCond, 'Column')
>
>
>where TableAlias is the name of the table associated with the grid and grdMyGridName is the grid's name.

Thanks as always Naomi

Liked Boris's method - very easy to use and change

Colin
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Reply
Map
View

Click here to load this message in the networking platform