When I add a row to dhtmlxtreegrid using the addRowBefore ap

There is no direct way to do such action through JS API, you can set any css string through
grid.setRowTextStyle(…

If you need to set exactly css class, you can use next workaround
var new_row=grid.addRowBefore(…
new_row.className=“some_css_class”;