Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically Setting Grid Column Dynamic Backcolor
Message
De
02/09/2005 10:44:55
 
 
À
02/09/2005 10:41:15
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01046179
Message ID:
01046232
Vues:
14
I have it working now for one field. Thanks for the ideas Cetin.

>>Jeesh Sergey, I feel pretty silly. I know it is Friday, but I must still be overlooking something. When the grid is defined, it now changes the color for the column (see Example1 code below), however, if there are three rows in the grid then all three rows have the column changed to the special color, not just one row. How do I set it for just one column in only one row? (A single cell)
>>
>>When I check the property value it is RGB(255,255,0) no matter the row and no matter the value in the cell. I seem to be setting it and not storing the call to the getpolicycolor() instead so it can process it for each row?
>>
>>In the 2nd example below I get the call to the function stored as a character string but it doesn't actually run the function call at any point so no cells in any columns change at all.
>>
>>
>>1st Example
>>
>>*--In debugger entire column is correct color including all rows
>>WITH this.pgfprofile.pagpolicy.policygrid
>>   FOR nColumnID = 1 TO .columncount
>>	colorvalue = thisform.getpolicycolor(.recordsource,.columns(nColumnID).controlsource)
>>	.Columns(nColumnID).dynamicbackcolor = colorvalue
>>        *--ColorValue = RGB(255,255,0)
>>        *--Column dynamicbackcolor property is same as colorvalue
>>        *--but it is set for the column and includes all of the rows
>>   ENDFOR
>>ENDWITH
>>
>>2nd example:
>>
>>*--This one has the function in the property correctly but it doesn't evaluate it
>>WITH this.pgfprofile.pagpolicy.policygrid
>>   FOR nColumnID = 1 TO .columncount
>>      colorvalue = "thisform.getpolicycolor('" + .recordsource + "','" + .columns(nColumnID).controlsource + "')"
>>      .Columns(nColumnID).dynamicbackcolor = colorvalue
>>
>>      *--ColorValue = "this.getpolicycolor('TPOLICY','PO_STATUS')"
>>      *--This is correct, however it is stored as a character expression and doesn't run dyanmically
>>   ENDFOR
>>ENDWITH
>>
>
>Include whole expression in parentheses. Check your GetPolicyColor method for all rows problem.
>Cetin
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform