> 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