>Hi all,
>
>Can you display more then 2 colors dynamically within a Grid. I'd like to color individual cells to one of 4 different colors depending on data in record. Setall allows only for 2.
Set the dynamic*color to "myalias.nColor", and stuff the good rgb() values in the nColor field. I assume you're showing a cursor here, so adding an integer field or two (if you want more than one set of colors, one for each column - then add nColor2, nColor3 etc.) wouldn't be a problem.
When I say RGB() values I mean integers, not string expressions to be evaluated. For example, if you wanted yellow, it would require a 65535 (since VFP's color values are actually BGR - rgb(255,255,0) equals 0x00ffff, i.e. 65535). So just fill all the values before showing (or before refreshing) the grid and watch it.
This is the fastest way of coloring grids I've found so far - it only needs to read a color value from another field, no iif()s, no nested iif()s, no functions, no method calls, nothing. I've been using this since VFP6SP4, and the grid refreshes are still fast, even on a 200MHz machine with debugger on. With a method call for a dynamic*color, it took about 5 minutes on such a machine to refresh a 12x8 grid with debugger on.