SetRowColor after loading Data


i created a Grid - Data comes from xml dataProcessor.
How can i change the Textcolor of a row after loading the data.

If the value off cell2 is “no” then the rowTextColor should be red.

I know the API Method : mygrid.setRowTextStyle
but how can I do this automaticly after loading the grid für all row`s…

Thx for your help.


I think you can choose…

a) Use your own eXcell style

b) You can set color in xml

c)Use event “onXLE”

and use something like:

var totalRow=grid.getRowsNum();//in smart rendering returns expected number of rows 
   if(grid.cells(i,0).getValue()=="no") grid.setRowColor(i, "red");

note: i guess this will be slow

d) Use forEachRow method


thank you for your answer.
I tried for “testing” this opionion:

mygrid.attachEvent(“onXLE”, function() {
var totalRow=mygrid.getRowsNum();
if(mygrid.cells(i,3).getValue() == “yes”) mygrid.setRowTextStyle(i, “color:red”);

But i doesn`t work - Chrome Console says:
Cannot read property ‘_childIndexes’ of null…

Any Idea?


Unfortunately the issue cannot be reproduced locally.
Please, make sure that you address to a existing row id.

Hello - this works:

mygrid.attachEvent("onXLE", function(grid_obj,count) {
    	var totalRow=mygrid.getRowsNum();
			rid = mygrid.getRowId(i);			
			if(typeof rid != 'undefined'){
				if(mygrid.cells(rid,5).getValue() == "yes") mygrid.setRowTextStyle(rid, "color:blue");
				if(mygrid.cells(rid,15).getValue() == "1") mygrid.cells(rid,0).setBgColor('Aquamarine');