Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help with grid cell color
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00366320
Message ID:
00366415
Vues:
14
If the name of the 3rd field is mycolor:
THISFORM.Grid1.Column3.DynamicBackColor = ;
"mycolor"

OR 

THISFORM.Grid1.Column3.DynamicBackColor = ;
"MyTable.mycolor"
Think of the Dynamic properties as the character expression passed to an EVAL(): DynamicBackColor must evaluate to BackColor which is a numeric. And since mytable.mycolor is a numeric field, then passing the string "mytable.mycolor" to eval() will evaluate to a numeric (the RGB value).

Rick

>The grid is bound to the table as evidenced by the 1st and 2nd columns display the values in those table records. The third column is not bound to the table because I don't want to display the value I just want it to have a background color, nothing more. In other words the table looks like this
>
>1) a High 1239402
>2) b Medium 392012
>3) c Low 39019
>
>The grid would have a,b,c in the first column, hat, shoe and pant in the second column and the third column would show no data but the back color would be tied to the third field. The user has the ability to tie a color to a code/description combination so I want to display that color in the third column. Therefore, this can't be tied to any logic it just needs to pick up an attribute from the table record. As close as I can get using the dynamic value is have it paint the entire column the color of the last record written to. I think the problem is just syntax, but I've tried every combination in the DynamicBackColor property I can think of.
Rick Hodder
MCP Visual Foxpro
C#, VB.NET Developer
Independent Consultant
www.RickHodder.com
MyBlog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform