Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing Backcolor property of a grid's specific cell
Message
From
06/12/2000 16:09:57
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00450099
Message ID:
00450112
Views:
37
Use the setall command. Make sure you lock and unlock your screen when you do this. I believe the procedure has to be in code(prg) not in the form. It has been a while since I wrtoe this.

EXAMPLE
This.Grid1.RECORDSOURCE = 'COMBINED'
THIS.grid1.SETALL("DynamicForeColor",;
"gridcolor(rtrim(thisform.grid1.recordsource))",;
"column")
GO TOP
THIS.grid1.REFRESH

*~*~*~*~*~*~~*~*~*~*~*~*~*~*~~*~*~*~*~*~*~*~*~*~*
PROCEDURE gridcolor
LPARAMETERS tsrecordsource
LOCAL lnbackcolor, lsfield, lsfieldvalue

lnbackcolor = 0
lnbackcolor = RGB(255,255,255) && Default to White

IF !EMPTY(tsrecordsource)
lsfield = tsrecordsource + ".Tableid"
lsfieldvalue = ALLTRIM(EVALUATE(lsfield))
IF lsfieldvalue = "1"
* tfip table - Dark Blue
lnbackcolor = RGB(37,30,130)
ELSE
* tranfile dark red
lnbackcolor = RGB(64,0,0)
ENDIF
ENDIF

RETURN lnbackcolor
ENDPROC
*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~
Previous
Reply
Map
View

Click here to load this message in the networking platform