There are actually some really good examples of this in the samples included with vfp. You can also see exactly how it works by using the builder for the grid. Basically you use the DynamicBackColor to return a value which will be used to set the background color of each cell in a collumn. If you want each row to be colored, then in the init method for your grid, issue the following command:
*this.setall("DynamicBackColor", --command or function to return color--,"Column")
Paul Moon