Setting a custom default column style

dhtmlxGrid v2.5

The data in my grid is maintained by Javascript. The user enters some value, a calculation is performed and the grid is populated using addRow(). I’m familiar with initializing the grid with setColAlign(). The problem is, I need to right pad the contents of the columns that are right aligned.

Is there a way to do this besides using setCellTextStyle after the cell is loaded?

Currently, this is what I’m doing:

sgDebts.setCellTextStyle(i,5,“color:#aaa; font-family:Verdana,Tahoma; padding-right:4px;”);

This technique breaks the setting for the selected row as set by the call to setStyle().

Also, I would rather set a custom default style with font and padding details and forget about it rather than (re)setting the style everytime a new row is added to the grid.

Thanks.

Unfortunately in your situation the only way is setCellTextStyle() method

For changing a default font you may try to use CSS.
For example:
div.gridbox_dhx_skyblue table.obj tr td{
font-family:Verdana,Tahoma
}