Set cell color beforeRender

I am aware of how to set the row style of a grid before its sent using

$data->set_row_style(“color:red;”);

however, is it possible to set the sytle of a single cell within the row in the same manner? I cannot seem to find this in the documentation… I want to set a call font color to red if the value is less than zero in a similiar manner to how excel does this…

thanks!

You can use any xml attributes which are supported by the grid. Style for cell can be set through cell@style which in connector can be set as

$data->set_cell_attribute("column_name","style","style value");

thanks I’m trying this

$action->set_cell_attribute(“UserStatus”,“font color”,“red”);

but getting a ‘not well-formed’ error when the grid tries to load the XML

Probably my suggestion was not clear enough, the correct code will looks as

$data->set_cell_attribute("UserStatus","style","color:red;");

I understand now! thanks Stanislav.