Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic color of each cell within a grid
Message
De
15/09/1999 19:37:34
 
 
À
15/09/1999 18:14:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00265225
Message ID:
00265273
Vues:
20
I believe that will only give him 2 color options Mike. Not the 3 colors he wants.

I just solved the problem on a project of my own today by doing this...


thisform.grdEDIPending.SetAll("DynamicBackColor", "iif((edipending.duedatetime-datetime())/60 <= 20,RGB(255,0,0),iif((edipending.duedatetime-datetime())/60 <= 30,RGB(255,255,128),iif((edipending.duedatetime-datetime())/60 <= 45,RGB(128,255,128),RGB(255,255,255))))", "Column")


The 'IIF' parts are the key. I'm nesting them so I can specify more than two colors than if I just used one 'IIF'. Of course, my code is NOT for each indivdual column but for all columns in a row. You can adust the code as Mike suggested below. I also tried using a form method to return an RGB value but I couldn't get it work...

thisform.grdEDIPending.SetAll("DynamicBackColor",thisform.setbackcolor, "Column")



Hope this helps Greg.

- A Hilton


>Doh! Here you go:
>
>
for each cColumn in This.Columns
>	cColumn.DynamicBackColor='iif(eval(this.'+cColumn.Name+'.controlsource)=<b>Condition</b>,rgb(255,0,0),rgb(0,255,0))'
>endfor
A Hilton
Software & Technology Development,
Programming & Business Process Consulting
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform