How do I change the styles for cells when using a browser grid? SetStyleRange() doesn't appear to be working?

You can change the appearance of individual columns with

   SetStyleRange(CGXRange().SetCols(nCol),
      CGXStyle()
            .SetHorizontalAlignment(DT_LEFT)
            .SetInterior(RGB(255,0,0))
      );

You might also format groups of cells by changing their base style.

Example:

   BaseStyle(GetDaoParam()->m_bsNumeric).ChangeStyle(
CGXStyle()
.SetHorizontalAlignment(DT_LEFT)
.SetFont(CGXFont().SetFaceName("Courier New"))
      , gxOverride);

But, you can't change the formatting of individual cells with SetStyleRange().  If you want to outline individual cells you need to override OnLoadCellStyle() (see previous question).

The reason for this behavior is that if the grid would allow you to apply formatting with SetStyleRange(), they would be bound directly to the cell.  But, what happens if there would have been rows inserted in the recordset, if the filter changes or if you do a requery? Most times, when you want to format cells in a DAO or ODBC Grid, it is because you want to outline depending on their context.  And for outlining a cell on its context, overriding OnLoadCellStyle and supply the cells formatting at runtime is the only way.

BTW, this behavior is also controlled through the CGXBrowseParam::m_bCanStoreGridCellInCGXData attribute.  Take a look at the description of the CGXBrowseParam class.