Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: DEREK DODOO
  Where is DEREK DODOO?
 READING, UK
 United Kingdom
 DEREK DODOO
Subject: RE: assign different colors in rows in grid
Thread ID: 180342 Message ID: 180359 # Views: 3 # Ratings: 0
Version: Visual FoxPro 6 Category: Grids
Date: Thursday, June 26, 2008 8:33:16 PM         
   



> Dear Expert,
>
>
> I'm trying to assign different colors to various rows based on codes in a grid.
>
> There are 10 codes which I'd like to assign different colours.
>
> The rows in the grid are ordered by the codes.
>
> This will enable the user to distinguish between the various codes
>
>
> Thanks


Insert your ten codes and then the rgb() value you want for each in a table:
SELECT DISTINCT code, CAST(0 AS Int) AS rgb FROM MyTable INTO TABLE DynColor 
REPLACE ALL rgb WITH GetColor()

In the grid init:
 This.Setall('DynamicBackColor',"Lookup(Dyncolor.rgb,code,dyncolor.code)",'Column')


-Anders

ENTIRE THREAD

assign different colors in rows in grid Posted by DEREK DODOO @ 6/26/2008 7:26:44 PM
RE: assign different colors in rows in grid Posted by Cetin Basoz @ 6/26/2008 8:05:15 PM
RE: assign different colors in rows in grid Posted by Borislav Borissov @ 6/26/2008 8:22:28 PM
RE: assign different colors in rows in grid Posted by Anders Altberg @ 6/26/2008 8:33:16 PM