Odd & Even on DhtmXTreeGrid

Hi all,

I’m trying to reproduce the alternate odd & even lines as it appears here but with api initialization instead of xml initilization.

Whatever i did, i have a result like this

Is there a way to have the same alternate odd & even witout xml intialization ?

Thank you in advance.
Ric

Is there a way to have the same alternate odd & even witout xml intialization ?

For the odd/even row coloring you may use the enableAlterCss() method:
docs.dhtmlx.com/grid__styling.ht … ddgridrows

For the column coloring you may use the setColumnColor() method:
docs.dhtmlx.com/grid__styling.html#column

Thanx a lot, it works fine :slight_smile:
I put this juste after the load :

        mygrid.loadXML("./test_list_1.xml");
        mygrid.enableAlterCss("ev_dhx_skyblue","odd_dhx_skyblue");

Thank you again.
Ric

You may call this method before the data loading, but note it should be called AFTER the skin definition, otherwise the styles will be overridden

mygrid.setSkin("dhx_skyblue") mygrid.enableAlterCss("ev_dhx_skyblue","odd_dhx_skyblue");