Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Highlighter Question
Message
 
À
16/07/2002 09:35:31
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00677892
Message ID:
00679173
Vues:
19
>Hi Nick.
>
>
>Is there a way to do the following:
>
>I have a grid that lists members of a national association with the rows being colored as to type of member. When I use grid highlighter, I lose the previously set rowcolors. I tried using cCustomCondition = 'this.setMemberColor()', lCustomCondition = .t., but I keep having problems.
>
>I could really use the help, as I spent about 8 hours yesterday, trying to figure this out.
>
>Thanks...

Hi John,

Sure there is.
Drop your custom condition - it is for simple conditions only. (Reset .cCustomCondition and .lCustomCondition to default).

Let's say, you have a custom function my_color(). I am not sure where your .setMemberColor() method belongs to, but you can use it with proper addressing instead.
* my_color.prg
LPARAMETER tnValue && the key value in the record. - your member type value
LOCAL lnColor
DO CASE
	CASE tnValue = 3
		lnColor = RGB(0,255,255)
	CASE tnValue = 4
		lnColor = RGB(255,0,0)
	CASE tnValue = 5
		lnColor = RGB(0,255,0)
	CASE tnValue = 6
		lnColor = RGB(0,0,255)
	CASE tnValue = 7
		lnColor = RGB(255,255,0)
	OTHERWISE
		lnColor = RGB(255,255,255)
ENDCASE
RETURN lnColor
Put into the Gridhighlighter1.onPostSetDynamicColor() method the following:
*** onPostSetDynamicColor() method
cHost = .cHostname
THIS.PARENT.&cHost..SetAll("DynamicBackColor",;
"IIF(RECNO('your_grid_record_source')= this.parent.Gridhighlighter1.nRecno,EVAL(this.parent.gridHighlighter1.cHighBackColor),my_color(your_key_value_field_here))","Column")
You may not use SetAll if you don't want to, but set the DynamicBackColor for certain columns only.
You can use the same way for records forecolor.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform