WebDBGrid Cell background color

Is there a way to change the background/brush color on a cell based on a value?  If the database field value for a cell is = green, paint the cell background color green for example?

I was looking through the demo's and didn't see anything allowing that kind of control on individual cells for the WebDEGrid.


You can use the OnGetCellChildren event. 
This event is triggered for each cell and returns the cell HTML TD element via AElement parameter.
There you could set a style property depending on cell value, i.e.


Ahhh  I didn't even think to use the Element Style.  Nice!  


to paint entire row ? or better to have a row selection in OnGetCellChildren or DblClickCell event ?


If what you need is indicated selected row, set goRowSelect = true in grid.Options, then you do not need to deal with cell clicking.

I use WebDBTableControl, i can ?

If you create a CSS class to set a background color, you can make an entire row colored using something like:

 .redcell { background-color: red; }

procedure TForm3.WebTableControl1GetCellClass(Sender: TObject; ACol,
  ARow: Integer; AField: TField; AValue: string; var AClassName: string);
  if arow = 5 then
    AClassName = 'redcell';

ok bruno go fine , but i must restore 'natural' rows color of entire grid before selecting another , otherwise i have many rows red !