Sytze:  Here is an example of a grid that is highlighted one of six
different colors based on vtank.cur_ostat.  This code is the .init of the
grid.  This takes care of everything with respect to highlighting and there
is no performance problem because of the nested IIF's.

WITH THIS
  .gridactiveforecolor = RGB(255,255,255)
  .griddefaultforecolor =  EVALUATE(LEFT(RGBSCHEME(1,1),;
         AT(',',RGBSCHEME(1,1),3) - 1) + ')') 
  .gridactivebackcolor = EVALUATE('RGB(' + ;
         SUBSTR(RGBSCHEME(1,6),AT(',',RGBSCHEME(1,6),3) + 1)) 
  .griddefaultbackcolor =   EVALUATE('RGB(' + ;
         SUBSTR(RGBSCHEME(1,1),AT(',',RGBSCHEME(1,1),3) + 1)) 

  IF !EMPTY(.RecordSource)
    .ncurrentrecord = RECNO(.RecordSource)
    .SetAll("DynamicForeColor", ;
      "IIF(RECNO(THIS.RecordSource) = THIS.ncurrentrecord, ;
      THIS.gridactiveforecolor, ;
      THIS.griddefaultforecolor)", ;
      "COLUMN")
    .SetAll("DynamicBackColor", ;
       "IIF(RECNO(THIS.RecordSource) = THIS.ncurrentrecord," + ;
         "THIS.gridactivebackcolor," + ;
         "IIF(vtank.cur_ostat = 'S'," + ;
           "RGB(0,255,0)," + ;
           "IIF(vtank.cur_ostat = 'A'," + ;
             "RGB(0,200,0)," + ;
             "IIF(vtank.cur_ostat = 'D'," + ;
               "RGB(0,128,0)," + ;
               "IIF(vtank.cur_ostat ='W'," + ;
                 "RGB(255,0,0)," + ;
                 "IIF(vtank.cur_ostat = 'C'," + ;
                   "RGB(0,0,255)," + ;
                   "THIS.griddefaultbackcolor))))))", ;
       "COLUMN")

  ENDIF
ENDWITH  

Jeff

Jeff Johnson
[EMAIL PROTECTED]
623-582-0323
Fax 623-869-0675

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of Sytze de Boer
> Sent: Monday, February 12, 2007 4:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: VFP 9, Grid highlighting
> 
> Because I don't know how
> Sytze
> 
> 
> 


--- StripMime Report -- processed MIME parts ---
multipart/signed
  text/plain (text body -- kept)
  application/x-pkcs7-signature
---


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to