Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I change the color of grid cells?
Message
De
11/01/2000 17:29:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00316406
Message ID:
00316530
Vues:
17
>How do I change the color of cells in a column depending on criteria in a table?
>
>i.e. If a part has been ordered I want the cell in only the first column to be blue. If it has been received I want it to be green. If it is on back order then red, etc.
>
>I can cut and paste the example for DynamicBackColor and it works just fine for the entire row because it uses setall. I put a function in it and it colors entire rows with as many colors as I want but each row is only one color.
>
>What I need is a way to change the color of individual cells in only one column or even better at random as needed througout the entire grid. I did get the current cell to highlight in yellow by setting the dynamicbackcolor to white and the backcolor to yellow. Problem with that was that the blank area below that last record also showed yellow. Kind of ugly. There must be a better way but I have run out of combinations of commands to try.
>
>Thanks for the advice.

Instead of SetAll, just use:

THISFORM.Grid1.Column1.DynamicBackColor = "IIF(MyCondition,255,0)"

to set a single column.
Erik Moore
Clientelligence
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform