Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Stego
  Where is Stego?
 Redlands
 California - United States
 Stego
 Tags
Subject: RE: Grid Row Color based on Data In Column 1
Thread ID: 22904 Message ID: 22907 # Views: 25 # Ratings: 0
Version: Visual FoxPro 6 Category: Grids
Date: Tuesday, April 29, 2003 9:01:05 PM         
   


> Hello there!
> I've looked through the FAQ and the Forums and cannot find an answer to this, thus I ask:
>
> I've got a Grid that is 8 colums wide, and several rows deep.
> Based on the Text that shows in column 1, I'd like to change the color of that particular row.
> What I'd like to find out is, How do I reference the data contained in a grid cell on the same row? Ive tried
>
> thisform.jogrid.setall("DynamicBackColor", ;
> "iif(activerow.column1.text = '*', RGB(255,0,0);
> ,RGB(255,255,255))", "Column")
>
> and a few other variations, and it allways says the expression is invalid.

Hi,
Well... if you are trying to get the entire row to change background color based upon
moving into it.... in VFP 6.0 a pain in the butt. I worked around this via adding a logical
field to the table. When I moved into the record in the BeforeRowChange event I changed
the logical field to .t. and in the AferRowChange event changed the logical field back to .f.
Then I used the DynamicBackColor with an IIF() fuction to change the color.
Note: Do not issue at tableupdate() with the value changed to .t., or when you again
call the form with the grid the background color will be set like you have your record
pointer on it.

If you obtain VFP8.0 this ability is handled automatically within the grid as a property
you can set.

My advice is to definately upgrade ASAP to version 8.0. I have found this release very
stable and far better than version 6.0, or 7.0.


Pete from the Great White North. (Only in Canada, ay.) Over and Out ...


COMPLETE THREAD

Grid Row Color based on Data In Column 1 Posted by Stego @ 4/29/2003 8:38:06 PM
RE: Grid Row Color based on Data In Column 1 Posted by Pete Sass @ 4/29/2003 9:01:05 PM
RE: Grid Row Color based on Data In Column 1 Posted by Khalil Shaddad @ 4/30/2003 6:49:55 AM