Index
2010-09-22 12:48Tina Currie : Change the colour of rows in a grid based on data
2010-09-22 12:54Fred Taylor : Re: Change the colour of rows in a grid based on data
2010-09-22 13:06Fred Taylor : Re: Change the colour of rows in a grid based on data
2010-09-22 13:09Michael Savage : Re: Change the colour of rows in a grid based on data
2010-09-22 14:12Tina Currie : RE: Change the colour of rows in a grid based on data
2010-09-22 14:27Jeff Johnson : Re: Change the colour of rows in a grid based on data
2010-09-22 14:42Stephen Russell : Re: Change the colour of rows in a grid based on data
2010-09-22 14:45Jeff Johnson : Re: Change the colour of rows in a grid based on data
2010-09-22 14:51Kent Belan : RE: Change the colour of rows in a grid based on data
2010-09-22 14:52Frank Cazabon : Re: Change the colour of rows in a grid based on data
Back to top
Change the colour of rows in a grid based on data

Author: Tina Currie

Posted: 2010-09-22 12:48:49   Link

Hi all,

I'm displaying a grid of some stuff the user wants to see from a search

screen. They put in the criteria and it selects to a cursor. Based on a

status field in the data, I want to colour code each line in the grid so

they can easily see which jobs are at which status.

I've done this before when I was checking only one field and changed it

based on whether that field was true or false. Code worked a treat and

looked like this:

thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

B(255,255,255))", "Column")

thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

RGB(0,0,0))", "Column")

Now the field I want query has 3 possible status codes and I want a

different colour row for each one. I've tried the following with no joy:

SELECT CurSearchResults && the cursor I selected into

SCAN

DO CASE

CASE SearchByClient.status = '00' && To Be Allocated

thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

'00',RGB(2,136,200),RGB(255,255,255)", "Column")

thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

'00',RGB(255,255,255),RGB(0,0,0)", "Column")

CASE SearchByClient.status = '10' && Allocated

thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

'10',RGB(128,255,0),RGB(255,255,255)", "Column")

thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

'10',RGB(255,255,255),RGB(0,0,0)", "Column")

CASE SearchByClient.status = '20' && To Be Invoiced

thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

'20',RGB(145,0,72),RGB(255,255,255)", "Column")

thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

'20',RGB(255,255,255),RGB(0,0,0)", "Column")

ENDCASE

ENDSCAN

This code makes all lines in the grid blue, regardless of status. Is it

because I'm using SetAll? What am I missing and is what I want to do even

possible?

It's 2:45am here in Australia and this one kept me awake so I thought I'd

get up and deal with it....

TIA,

Tina

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/003901cb5a76$084bd7a0$18e386e0$@com.au

** 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.

©2010 Tina Currie
Back to top
Re: Change the colour of rows in a grid based on data

Author: Fred Taylor

Posted: 2010-09-22 12:54:37   Link

You need a multi-level IIF statement to handle all three conditions,

or you can call a function or method that checks the conditions and

returns the color in your SetAll call.

Fred

On Wed, Sep 22, 2010 at 9:48 AM, Tina Currie <tina@datahouse.com.au> wrote:

> Hi all,

>

>

>

> I'm displaying a grid of some stuff the user wants to see from a search

> screen.  They put in the criteria and it selects to a cursor.  Based on a

> status field in the data, I want to colour code each line in the grid so

> they can easily see which jobs are at which status.

>

>

>

> I've done this before when I was checking only one field and changed it

> based on whether that field was true or false.  Code worked a treat and

> looked like this:

>

>

>

> thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

> B(255,255,255))", "Column")

>

> thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

> RGB(0,0,0))", "Column")

>

>

>

> Now the field I want query has 3 possible status codes and I want a

> different colour row for each one.  I've tried the following with no joy:

>

>

>

> SELECT CurSearchResults  && the cursor I selected into

>

> SCAN

>

>      DO CASE

>

>            CASE SearchByClient.status = '00'  && To Be Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '00',RGB(2,136,200),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '00',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '10'  && Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '10',RGB(128,255,0),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '10',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '20'  && To Be Invoiced

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '20',RGB(145,0,72),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '20',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>      ENDCASE

>

> ENDSCAN

>

>

>

> This code makes all lines in the grid blue, regardless of status.  Is it

> because I'm using SetAll? What am I missing and is what I want to do even

> possible?

>

> It's 2:45am here in Australia and this one kept me awake so I thought I'd

> get up and deal with it....

>

>

>

> TIA,

>

>

>

> Tina

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

>  text/plain (text body -- kept)

>  text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTin_uyJVfo2krpLisXUerD-D0aKyUFMNE3XCuRhn@mail.gmail.com

** 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.

©2010 Fred Taylor
Back to top
Re: Change the colour of rows in a grid based on data

Author: Fred Taylor

Posted: 2010-09-22 13:06:52   Link

Also, another option may be you can use the ICASE function for

multiple cases in your SetAll if you're using VFP9.

Fred

On Wed, Sep 22, 2010 at 9:48 AM, Tina Currie <tina@datahouse.com.au> wrote:

> Hi all,

>

>

>

> I'm displaying a grid of some stuff the user wants to see from a search

> screen.  They put in the criteria and it selects to a cursor.  Based on a

> status field in the data, I want to colour code each line in the grid so

> they can easily see which jobs are at which status.

>

>

>

> I've done this before when I was checking only one field and changed it

> based on whether that field was true or false.  Code worked a treat and

> looked like this:

>

>

>

> thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

> B(255,255,255))", "Column")

>

> thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

> RGB(0,0,0))", "Column")

>

>

>

> Now the field I want query has 3 possible status codes and I want a

> different colour row for each one.  I've tried the following with no joy:

>

>

>

> SELECT CurSearchResults  && the cursor I selected into

>

> SCAN

>

>      DO CASE

>

>            CASE SearchByClient.status = '00'  && To Be Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '00',RGB(2,136,200),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '00',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '10'  && Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '10',RGB(128,255,0),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '10',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '20'  && To Be Invoiced

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '20',RGB(145,0,72),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '20',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>      ENDCASE

>

> ENDSCAN

>

>

>

> This code makes all lines in the grid blue, regardless of status.  Is it

> because I'm using SetAll? What am I missing and is what I want to do even

> possible?

>

> It's 2:45am here in Australia and this one kept me awake so I thought I'd

> get up and deal with it....

>

>

>

> TIA,

>

>

>

> Tina

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

>  text/plain (text body -- kept)

>  text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTimJFdva=6Hgedab1Po2KMw3fR6YAACDXkgYau=D@mail.gmail.com

** 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.

©2010 Fred Taylor
Back to top
Re: Change the colour of rows in a grid based on data

Author: Michael Savage

Posted: 2010-09-22 13:09:40   Link

Look at the ICASE command, easier to read and debug than nested IIF's.

That with SetAll, does neat things.

Mike

On 22/09/2010 12:48 PM, Tina Currie wrote:

> Hi all,

>

>

>

> I'm displaying a grid of some stuff the user wants to see from a search

> screen. They put in the criteria and it selects to a cursor. Based on a

> status field in the data, I want to colour code each line in the grid so

> they can easily see which jobs are at which status.

>

>

>

> I've done this before when I was checking only one field and changed it

> based on whether that field was true or false. Code worked a treat and

> looked like this:

>

>

>

> thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

> B(255,255,255))", "Column")

>

> thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

> RGB(0,0,0))", "Column")

>

>

>

> Now the field I want query has 3 possible status codes and I want a

> different colour row for each one. I've tried the following with no joy:

>

>

>

> SELECT CurSearchResults&& the cursor I selected into

>

> SCAN

>

> DO CASE

>

> CASE SearchByClient.status = '00'&& To Be Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '00',RGB(2,136,200),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '00',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

> CASE SearchByClient.status = '10'&& Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '10',RGB(128,255,0),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '10',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

> CASE SearchByClient.status = '20'&& To Be Invoiced

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '20',RGB(145,0,72),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '20',RGB(255,255,255),RGB(0,0,0)", "Column")

>

> ENDCASE

>

> ENDSCAN

>

>

>

> This code makes all lines in the grid blue, regardless of status. Is it

> because I'm using SetAll? What am I missing and is what I want to do even

> possible?

>

> It's 2:45am here in Australia and this one kept me awake so I thought I'd

> get up and deal with it....

>

>

>

> TIA,

>

>

>

> Tina

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C9A3854.9010004@golden.net

** 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.

©2010 Michael Savage
Back to top
RE: Change the colour of rows in a grid based on data

Author: Tina Currie

Posted: 2010-09-22 14:12:05   Link

How did I not know about ICASE() ???

Thanks - will give it a go.

Tina

-----Original Message-----

From: Fred Taylor [mailto:fbtaylor@gmail.com]

Sent: Thursday, 23 September 2010 3:07 AM

To: ProFox Email List

Subject: Re: Change the colour of rows in a grid based on data

Also, another option may be you can use the ICASE function for

multiple cases in your SetAll if you're using VFP9.

Fred

On Wed, Sep 22, 2010 at 9:48 AM, Tina Currie <tina@datahouse.com.au> wrote:

> Hi all,

>

>

>

> I'm displaying a grid of some stuff the user wants to see from a search

> screen.  They put in the criteria and it selects to a cursor.  Based on a

> status field in the data, I want to colour code each line in the grid so

> they can easily see which jobs are at which status.

>

>

>

> I've done this before when I was checking only one field and changed it

> based on whether that field was true or false.  Code worked a treat and

> looked like this:

>

>

>

>

thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

> B(255,255,255))", "Column")

>

>

thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

> RGB(0,0,0))", "Column")

>

>

>

> Now the field I want query has 3 possible status codes and I want a

> different colour row for each one.  I've tried the following with no joy:

>

>

>

> SELECT CurSearchResults  && the cursor I selected into

>

> SCAN

>

>      DO CASE

>

>            CASE SearchByClient.status = '00'  && To Be Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '00',RGB(2,136,200),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '00',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '10'  && Allocated

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '10',RGB(128,255,0),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '10',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>

>

>            CASE SearchByClient.status = '20'  && To Be Invoiced

>

>

> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

> '20',RGB(145,0,72),RGB(255,255,255)", "Column")

>

>

> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

> '20',RGB(255,255,255),RGB(0,0,0)", "Column")

>

>      ENDCASE

>

> ENDSCAN

>

>

>

> This code makes all lines in the grid blue, regardless of status.  Is it

> because I'm using SetAll? What am I missing and is what I want to do even

> possible?

>

> It's 2:45am here in Australia and this one kept me awake so I thought I'd

> get up and deal with it....

>

>

>

> TIA,

>

>

>

> Tina

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

>  text/plain (text body -- kept)

>  text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/000901cb5a81$aa323810$fe96a830$@com.au

** 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.

©2010 Tina Currie
Back to top
Re: Change the colour of rows in a grid based on data

Author: Jeff Johnson

Posted: 2010-09-22 14:27:10   Link

This is in the init of the grid

.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")

This colors the rows in a grid based on order status. ;^)

Jeff

---------------

Jeff Johnson

jeff@san-dc.com

(623) 582-0323

www.san-dc.com

On 09/22/2010 11:12 AM, Tina Currie wrote:

> How did I not know about ICASE() ???

>

> Thanks - will give it a go.

>

> Tina

>

>

> -----Original Message-----

> From: Fred Taylor [mailto:fbtaylor@gmail.com]

> Sent: Thursday, 23 September 2010 3:07 AM

> To: ProFox Email List

> Subject: Re: Change the colour of rows in a grid based on data

>

> Also, another option may be you can use the ICASE function for

> multiple cases in your SetAll if you're using VFP9.

>

> Fred

>

>

>

> On Wed, Sep 22, 2010 at 9:48 AM, Tina Currie<tina@datahouse.com.au> wrote:

>

>> Hi all,

>>

>>

>>

>> I'm displaying a grid of some stuff the user wants to see from a search

>> screen. They put in the criteria and it selects to a cursor. Based on a

>> status field in the data, I want to colour code each line in the grid so

>> they can easily see which jobs are at which status.

>>

>>

>>

>> I've done this before when I was checking only one field and changed it

>> based on whether that field was true or false. Code worked a treat and

>> looked like this:

>>

>>

>>

>>

>>

> thisform.Grid1.SetAll("DynamicBackColor","IIF(offhired=.t.,RGB(2,136,200),RG

>

>> B(255,255,255))", "Column")

>>

>>

>>

> thisform.Grid1.SetAll("DynamicForeColor","IIF(offhired=.t.,RGB(255,255,255),

>

>> RGB(0,0,0))", "Column")

>>

>>

>>

>> Now the field I want query has 3 possible status codes and I want a

>> different colour row for each one. I've tried the following with no joy:

>>

>>

>>

>> SELECT CurSearchResults&& the cursor I selected into

>>

>> SCAN

>>

>> DO CASE

>>

>> CASE SearchByClient.status = '00'&& To Be Allocated

>>

>>

>> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

>> '00',RGB(2,136,200),RGB(255,255,255)", "Column")

>>

>>

>> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

>> '00',RGB(255,255,255),RGB(0,0,0)", "Column")

>>

>>

>>

>> CASE SearchByClient.status = '10'&& Allocated

>>

>>

>> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

>> '10',RGB(128,255,0),RGB(255,255,255)", "Column")

>>

>>

>> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

>> '10',RGB(255,255,255),RGB(0,0,0)", "Column")

>>

>>

>>

>> CASE SearchByClient.status = '20'&& To Be Invoiced

>>

>>

>> thisform.Grid1.SetAll("DynamicBackColor","iif(CurSearchResults.status =

>> '20',RGB(145,0,72),RGB(255,255,255)", "Column")

>>

>>

>> thisform.Grid1.SetAll("DynamicForeColor","iif(CurSearchResults.status =

>> '20',RGB(255,255,255),RGB(0,0,0)", "Column")

>>

>> ENDCASE

>>

>> ENDSCAN

>>

>>

>>

>> This code makes all lines in the grid blue, regardless of status. Is it

>> because I'm using SetAll? What am I missing and is what I want to do even

>> possible?

>>

>> It's 2:45am here in Australia and this one kept me awake so I thought I'd

>> get up and deal with it....

>>

>>

>>

>> TIA,

>>

>>

>>

>> Tina

>>

>>

>>

>> --- StripMime Report -- processed MIME parts ---

>> multipart/alternative

>> text/plain (text body -- kept)

>> text/html

>> ---

>>

>>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C9A4A7E.401@san-dc.com

** 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.

©2010 Jeff Johnson
Back to top
Re: Change the colour of rows in a grid based on data

Author: Stephen Russell

Posted: 2010-09-22 14:42:03   Link

On Wed, Sep 22, 2010 at 1:27 PM, Jeff Johnson <jeff@san-dc.com> wrote:

> This is in the init of the grid

>

>      .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")

>

> This colors the rows in a grid based on order status.    ;^)

----------------

What are you double rainbow man?

;->

--

Stephen Russell

Sr. Production Systems Programmer

CIMSgts

901.246-0159 cell

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/AANLkTin5atp8SSAZkjyYobs0f60bOO9Za=xuWJ+XP=XB@mail.gmail.com

** 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.

©2010 Stephen Russell
Back to top
Re: Change the colour of rows in a grid based on data

Author: Jeff Johnson

Posted: 2010-09-22 14:45:38   Link

Actually this is a grid of orders. Each letter stands for a different

order status. ie orders are green if they are out for delivery, yellow

if they are late, and red if they were supposed to be delivered yesterday.

Jeff

---------------

Jeff Johnson

jeff@san-dc.com

(623) 582-0323

www.san-dc.com

On 09/22/2010 11:42 AM, Stephen Russell wrote:

> On Wed, Sep 22, 2010 at 1:27 PM, Jeff Johnson<jeff@san-dc.com> wrote:

>

>> This is in the init of the grid

>>

>> .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")

>>

>> This colors the rows in a grid based on order status. ;^)

>>

> ----------------

>

> What are you double rainbow man?

>

> ;->

>

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C9A4ED2.7080604@san-dc.com

** 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.

©2010 Jeff Johnson
Back to top
RE: Change the colour of rows in a grid based on data

Author: Kent Belan

Posted: 2010-09-22 14:51:54   Link

Here is a rainbow ... Whatever the user wants ...

* 1 2 3 4 5 6 7 8 9 10 11 12

*

Black,Red,Yellow,Purple,Pink,Peach,Orange,Lavender,Cream,White,Blue,Green

* 13 14 15 16 17 18 19 20 21 22 23 24

*

Gold,Burgundy,Plum,Apricot,Coral,Melon,Lime,Wine,Fuschia,Mauve,Rose,Brown

lcFindColor = [iif(findcolor = 1,rgb(0,0,0),] + ;

[iif(findcolor = 2,rgb(255,0,0),] + ;

[iif(findcolor = 3,rgb(255,255,0),] + ;

[iif(findcolor = 4,rgb(128,0,128),] + ;

[iif(findcolor = 5,rgb(255,0,128),] + ;

[iif(findcolor = 6,rgb(231,146,88),] + ;

[iif(findcolor = 7,rgb(255,128,0),] + ;

[iif(findcolor = 8,rgb(140,95,160),] + ;

[iif(findcolor = 9,rgb(255,255,128),] + ;

[iif(findcolor =10,rgb(255,255,255),] + ;

[iif(findcolor =11,rgb(0,0,255),] + ;

[iif(findcolor =12,rgb(0,128,0),] + ;

[iif(findcolor =13,rgb(226,203,37),] + ;

[iif(findcolor =14,rgb(128,0,0),] + ;

[iif(findcolor =15,rgb(128,0,128),] + ;

[iif(findcolor =16,rgb(255,128,0),] + ;

[iif(findcolor =17,rgb(255,192,130),] + ;

[iif(findcolor =18,rgb(163,255,70),] + ;

[iif(findcolor =19,rgb(0,255,0),] + ;

[iif(findcolor =20,rgb(181,34,56),] + ;

[iif(findcolor =21,rgb(255,0,255),] + ;

[iif(findcolor =22,rgb(128,64,64),] + ;

[iif(findcolor =23,rgb(254,1,20),] + ;

[iif(findcolor =24,rgb(106,53,53),] + ;

[rgb(0,0,0) ))))))))))))))))))))))))]

* Set Grid ForeColor

.SetAll("DynamicForeColor", lcFindColor, "Column")

* Set Grid BackColor

.SetAll("DynamicBackColor", "IIF(RECNO()=thisform.gnCurrRec,

rgb(0,255,255), rgb(210,210,210))", "Column")

-----Original Message-----

From: profox-bounces@leafe.com [mailto:profox-bounces@leafe.com] On Behalf

Of Stephen Russell

Sent: Wednesday, September 22, 2010 2:42 PM

To: ProFox Email List

Subject: Re: Change the colour of rows in a grid based on data

On Wed, Sep 22, 2010 at 1:27 PM, Jeff Johnson <jeff@san-dc.com> wrote:

> This is in the init of the grid

>

>      .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")

>

> This colors the rows in a grid based on order status.    ;^)

----------------

What are you double rainbow man?

;->

--

Stephen Russell

Sr. Production Systems Programmer

CIMSgts

901.246-0159 cell

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/20100922185202.1597124CAB4@marge.leafe.com

** 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.

©2010 Kent Belan
Back to top
Re: Change the colour of rows in a grid based on data

Author: Frank Cazabon

Posted: 2010-09-22 14:52:27   Link

How does a colour blind person tell the difference between out for

delivery and supposed to have been delivered yesterday? ;)

Frank.

Frank Cazabon

Samaan Systems Ltd. - Developing Solutions

www.SamaanSystems.com

Referrals are important to us.

If you know of anyone who would benefit from our services, please contact me. We would appreciate the opportunity to work with them.

On 22/09/2010 02:45 PM, Jeff Johnson wrote:

> Actually this is a grid of orders. Each letter stands for a different

> order status. ie orders are green if they are out for delivery, yellow

> if they are late, and red if they were supposed to be delivered yesterday.

>

> Jeff

>

> ---------------

>

> Jeff Johnson

> jeff@san-dc.com

> (623) 582-0323

>

> www.san-dc.com

>

>

> On 09/22/2010 11:42 AM, Stephen Russell wrote:

>> On Wed, Sep 22, 2010 at 1:27 PM, Jeff Johnson<jeff@san-dc.com> wrote:

>>

>>> This is in the init of the grid

>>>

>>> .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")

>>>

>>> This colors the rows in a grid based on order status. ;^)

>>>

>> ----------------

>>

>> What are you double rainbow man?

>>

>> ;->

>>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4C9A506B.5060400@gmail.com

** 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.

©2010 Frank Cazabon